1

I'm an trying to get the image to attach to mms after you pick my app form the attachment picklist. The image code is fine.

What I want to happen

1.You are in a text message, you click the attach button

2.you select images, it pulls up the chooser of apps

3.select my application, has gridview of images

4.(The Issue) - you select the photo you want from my app and it sends it back into the mms you where in

I'm not sure how to respond though to the ACTION_GET_CONTENT from the sms/mms app so that my app sends the image back to it.

    Uri uri = Uri.fromFile(file);
    Intent localIntent = new Intent(android.content.Intent.ACTION_SEND);
    localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    localIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
    //localIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
    localIntent.putExtra("android.intent.extra.STREAM", uri);
    localIntent.setType("image/jpeg");
    startActivity(localIntent);
Brain Monkey
  • 124
  • 8

1 Answers1

0

After literally a week of looking around I found it.

Intent localIntent = new Intent();                          localIntent.setData(imageURI(position));
setResult(Activity.RESULT_OK, localIntent);
dialog.dismiss();
finish();

I needed to use setResult

Brain Monkey
  • 124
  • 8
  • So were you using startActivityForResult() in your app to launch the SMS app and then use setResult() to return to the original Activity? If so, can you post the full code that includes startActivityForResult()? – AJW Apr 21 '20 at 00:26