https://kotlinlang.org logo
#android
Title
# android
n

Nandu

10/11/2023, 8:16 AM
Hello guys, I need to launch my application on click of a custom file extension e.g .xzz and I have tried to add the following intent filters but my app is not launching when tapping on this file, has anyone worked on this similar problem please share your thoughts
Copy code
<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:host="*" />
                <data android:mimeType="*/*" />
                <data android:pathPattern=".*\\.xyz" />
            </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="content" />
                <data android:host="*" />
                <data android:mimeType="*/*" />
                <data android:pathPattern=".*\\.xyz" />
            </intent-filter>
I tried with the following intent filters it's working but the issue is my app is launched when any unknown file is also tapped , but I want my app to be launched when tapping only .xyz file
Copy code
<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:host="*" />
                <data android:mimeType="application/octet-stream" />
            </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="content" />
                <data android:host="*" />
                <data android:mimeType="application/octet-stream" />
            </intent-filter>
not kotlin but kotlin colored 4
stackoverflow 1
🧵 3
c