I'm trying to load an email attachment in my application. I can get the content, but I cannot get the file name.
Here's how my intent filter looks like:
<intent-filter>
<action
android:name="android.intent.action.VIEW" />
<category
android:name="android.intent.category.DEFAULT" />
<data
android:mimeType="image/jpeg" />
</intent-filter>
Here is what I get:
INFO/ActivityManager(97): Starting: Intent { act=android.intent.action.VIEW dat=content://gmail-ls/messages/john.doe%40gmail.com/42/attachments/0.1/SIMPLE/false typ=image/jpeg flg=0x3880001 cmp=com.myapp/.ui.email.EmailDocumentActivityJpeg } from pid 97
In my activity I get the Uri and use it to get the input stream for the file content:
InputStream is = context.getContentResolver().openInputStream(uri);
Where can I find the file name in this scenario?