Hi All im a newbie developing an app for android i have one application say whatsapp using which we can select the pictures from gallery and send it to our friends . likewise im creating a similar app's activity which responds to ACTION_PICK intent ..
lets say i have received the intent from whatsapp to my activity using getIntent() and im going to send the result back using setResult().. in between i would like to know how to insert the drawable image resource from my app to whats app via setResult so that whatsapp can accept the image im clicking in my app and sends it to my friends.
the below code is a reference from developer.android.com
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Get the intent that started this activity
Intent intent = getIntent();
Uri data = intent.getData();
// Figure out what to do based on the intent type
if (intent.getType().indexOf("image/") != -1) {
// Handle intents with image data ...
**// wanted to know what code must be entered here.**
} else if (intent.getType().equals("text/plain")) {
// Handle intents with text ...
}
}
// Create intent to deliver some kind of result data
Intent result = new Intent("com.example.RESULT_ACTION", Uri.parse("content://result_uri");
setResult(Activity.RESULT_OK, result);
finish();