0

I just read other question like this .But when I am trying to get image path or uri its getting null value.

Here is may manifest code:

<activity
    android:name=".design.MyActivity"
    android:configChanges="orientation|screenSize"
    android:screenOrientation="portrait">
    <intent-filter>
         <action android:name="android.intent.action.SEND" />

         <category android:name="android.intent.category.DEFAULT" />
         <category android:name="android.intent.category.BROWSABLE" />

         <data android:host="*" />
         <data android:mimeType="image/*" />
     </intent-filter>
</activity>

And I am handling intent from MyActivity.java :

final Intent intent = getIntent();
final String action = intent.getAction();

if (Intent.ACTION_SEND.equals(action)) {
    Log.i("ImagePath>>>", intent.getData() + "");
}

Log showing ImagePath>>>null

Jayesh Rathod
  • 600
  • 1
  • 5
  • 18

1 Answers1

0

OK! I am sorry to late but you can get image path by using:

Uri uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);

May be this question helps other people! : )

Jayesh Rathod
  • 600
  • 1
  • 5
  • 18