I am trying to create an android application to open files with the extension .abc and this is the section of my application 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 specific file extension?
Android intent filter: associate an application with a file extension
Android How to create an Intent filter to expand a user file that DOES NOT make it part of the choice for everything on the phone
And in the end, it wonβt work - when I click on a file called "name.abc" in the ES file browser, it asks me if I want to open the file as text or image, etc., when it actually should have just open the file in my application instead
What am I doing wrong? What is the correct intent filter to run the application by simply clicking on the file with the appropriate extension in any file manager?
update
It seems that different Android systems and different file browsers act differently - one filter design works fine on 4.2 in "ES File Explorer" and on 4.0.4 in the default file manager, but does not work at all on 4.2 and 4.0.4 in "Total Commander" and 4.0.4 in "ES File Explorer"
source share