I am trying to make an android app to open files with extension .abc and this is my application section from android manifest xml
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:name="com.example.app.ActName" android:label="AppName">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:mimeType="image/jpeg"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\.abc" />
<data android:host="*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
I used all the experience from the most popular and related questions
Android intent filter for a particular file extension?
Android intent filter: associate app with file extension
Android How to create Intent Filter for custom file extension that does NOT make it part of a chooser for everything on the phone
And in the end this does not work - when I click on a file named "name.abc" in ES file browser it asks me if i want to open the file as text or image etc. when it actually supposed to just open the file in my app instead
What am i doing wrong? What is the proper intent filter to launch the app by just clicking a file with the corresponding extension in any file manager?
upd.
it looks like different android systems and different file browsers act in different way - one intent filter works just fine on 4.2 in "ES File Explorer" and on 4.0.4 in default file manager, but does not work at all on 4.2 and 4.0.4 in "Total Commander" and on 4.0.4 in "ES File Explorer"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…