Issue
I'm working on an android app which could view or edit pdf files.
My app shows up in the "Open file using..." screens. here is the screenshot
But when I click a pdf file from google files file manager app, it shows "Open with" screen and my app is not there. here is the screenshot
This is my intent filter in manifest.xml :
<intent-filter android:label="View or edit your pdf files">
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT"/>
<data android:scheme="content" />
<data android:mimeType="application/pdf" />
</intent-filter>
How can I make my app visible in the "Open with" screen like Drive Pdf Viewer and WPS Office in the second screenshot ?
Solution
I have applied your code in my app and everything worked fine. Don't know what exactly is happening here, but in your case you can define intent filters with lots of actions and data type (category is not necessary in my opinion) to see that if your app can be a candidate to handle the intent. Then in the activity receiving the intent, in the onNewIntent() method, you check all the properties of the incoming intent to see what's is missing in your current solution. All the possible intent's actions can be found in the document (you dont need to define all of them, just add the most popular ones and see the result) https://developer.android.com/reference/android/content/Intent
Answered By - Phúc Nguyễn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.