2

When user opens a file with an extension (say, .xyz), I want to launch my application.

I've added following intent-filters which didn't work.

<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" />
    <action android:name="android.intent.action.EDIT" />
    <action android:name="android.intent.action.PICK" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="content" />
    <data android:host="*" />
    <data android:mimeType="application/octet-stream" />
    <data android:pathPattern=".*\\.xyz" />
</intent-filter>

When I remove data android:pathPattern attribute, it works, but for all binary files, which is not what I want.

When I set data android:pathPattern as .* it still works for all binary files, but that is not what I want.

When I set data android:pathPattern as .* AND remove android:mimeType it doesn't work.

When I add a foo in the file path, this does not work: <data android:pathPattern="..*/foo/..*" />

I've also tried the same thing with android:pathAdvancedPattern but nothing worked.

None of these helped:

Android SDK version: 32

Help is appreciated.

Wolfie
  • 63
  • 5
  • Well we cannot help you as Android does not support what you want. Less than a few weeks ago this was asked here too and there this was told. – blackapps Nov 16 '22 at 14:14

0 Answers0