I want to advertise that my app is capable of viewing pdf files so that it will appear in the app chooser when a pdf file is selected from the file manager.
Here is what my intent filters look like
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:mimeType="application/pdf" />
</intent-filter>
</activity>
Whenever I open a pdf from file manager it automatically selects another pdf app called Polaris Viewer.
I checked to make sure that Polaris is not the default app, under application settings. It says no defaults set.
Also, I downloaded an third party app called Intent Intercept. If I select a pdf file from file manager an app chooser appears showing Polaris and Intent Intercept. If I choose Intent Intercept it tells me that both Polaris and my app (Rollout PdfEditor) match the intent. Here is the output from Intent Interceptor:
ACTION: android.intent.action.VIEW
DATA: file:///storage/sdcard0/Download/download.pdf TYPE: application/pdf
FLAGS: FLAG_ACTIVITY_FORWARD_RESULT FLAG_ACTIVITY_PREVIOUS_IS_TOP
EXTRAS: EXTRA 1: Class: java.lang.Boolean Key: preview Value: false EXTRA 2: Class: java.lang.String Key: key_filename Value: /storage/sdcard0/Download/download.pdf EXTRA 3: Class: android.net.Uri$HierarchicalUri Key: android.intent.extra.STREAM EXTRA 4: Class: java.lang.Integer Key: sort_order Value: 0
2 ACTIVITIES MATCH THIS INTENT: Polaris Viewer 4.1 (com.infraware.polarisviewer4 - com.infraware.polarisoffice4.OfficeLauncherActivity) Rollout PdfEditor (com.example.rolloutpdfeditor - com.example.rolloutpdfeditor.MainActivity) >