- CREATE NEW ACTIVITY (SIGNATURE) --- SHOULD DECLARE IN MANIFEST.XML
- USING (startActivityForResult ()) CALL SIGNATURE ACTIVITY
- SAVE SIGNATURE PNG IN MEDIA STORAGE.
- CONVERT .PNG FILE TO BASE64 FORMAT FOR EASY SHARE
- SEND BACK TO MAIN ACTIVITY WITH BUNDLE VALUE
- ACCESS THE BUNDLE VALUE USING (onActivityResult) FOR PROCESS.
2. CREATE MYSIGNATURE ACTIVITY IN PROJECT PACKAGE -
CLICK HERE TO ACCESS MySignature.java
3. CALL SIGNATURE ACTIVITY FROM USER ACTIVITY
CLICK HERE TO ACCESS MySignature.java
3. CALL SIGNATURE ACTIVITY FROM USER ACTIVITY
public static final int SIGNATURE_ACTIVITY = 1;
Intent intent = new Intent(ctx, MySignature.class);
startActivityForResult(intent,SIGNATURE_ACTIVITY);
4. GET SIGNATURE ACTIVITY TO USER ACTIVITY
publicprotected void onActivityResult(int requestCode, int resultCode, Intent data)
{
switch(requestCode) {
case SIGNATURE_ACTIVITY:
if (resultCode == RESULT_OK) {
Bundle bundle = data.getExtras();
String status = bundle.getString("status");
String data1 = bundle.getString("data");
if(status.equalsIgnoreCase("done")){
Toast toast = Toast.makeText(this, "Signature capture successful!", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.TOP, 105, 50);
toast.show();
}
}
break;
}
}
No comments:
Post a Comment