save a file when user share that

Viewed 21

I have a android application and want save file when user sharing that! My code is below:

<intent-filter>
       <action android:name="android.intent.action.SEND"/>
       <category android:name="android.intent.category.DEFAULT"/>
       <data android:mimeType="*/*"/>
</intent-filter>

and my activity onCreate code:

//...
Intent parentIntent = this.getIntent();
Uri fileUri = parentIntent.getData();

But while activity run, that crashed!

I how to get file path and save it? Please help me!

0 Answers
Related