• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Why is my ACTION_SEND working on API 25+ perfectly, but messes up on previous APIs?

So I have a Share button that will share an image and a body of text.

On Nougat (API 25) and Oreo (API 26), it works absolutely perfectly. But when it comes to a couple older version it doesn't work as expected.

Marshmallow (API 23): Inserts the image just fine but no body of text.
Lollipop (API 22): Crashes when you push the Share button with popup error "Unfortunately, Messaging has stopped."
Here is my share button code:

Java:
if (id == R.id.action_shareWine) {
            Intent intentShare = new Intent(Intent.ACTION_SEND);
            intentShare.putExtra(intentShare.EXTRA_STREAM, imageURI);
            intentShare.setType("image/*");
            intentShare.putExtra(Intent.EXTRA_TEXT, "body of text goes here");
            if (intentShare.resolveActivity(getPackageManager()) != null) {
                startActivity(intentShare);
            }
            return true;
        }

Here is a picture to give a visual idea of whats going on:

equTbeG.png


Anyone have any ideas what could be going on here?

Also, here is the crash log for the Lollipop emulator:

Code:
FATAL EXCEPTION: Mms-1
    Process: com.android.mms, PID: 7570
                                                
    java.lang.IllegalStateException: Couldn't read row 0, col 0 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.

Which I'm not sure why it is happening because the cursor is loading the image just fine in an ImageView in that same activity.
 
Back
Top Bottom