Ilya Gazman
Ilya Gazman

Reputation: 32231

ActivityNotFoundException with google+

I am trying to follow google tutorial for sharing image, but keep getting this exception:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND typ=jpg flg=0x80000 pkg=com.google.android.apps.plus (has extras) }
            at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1601)
            at android.app.Instrumentation.execStartActivity(Instrumentation.java:1465)
            at android.app.Activity.startActivityForResult(Activity.java:3190)
            at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:820)

Any ideas what it can be?

Upvotes: 0

Views: 122

Answers (1)

ianhanniballake
ianhanniballake

Reputation: 199880

When you set photoPicker.setType("video/*, image/*") that means that all returned images should have a mime type of video/* or image/* but it appears you are receiving just jpg. The calling photopicker should be changed to return the appropriate mime type - in this case, image/jpg.

Note that FileProvider can be used to easily create shareable links to files to send to other apps (appropriate for setStream()) as per the setting up file sharing training - it automatically takes care of mime type for you.

Upvotes: 2

Related Questions