I have read a couple of similar questions (Android intent filter for a particular file extension?, Creating app which opens a custom file extension, Associating App with Epub format), but my question is slightly different. Sorry for the long post with pictures, but it would be better to see what I mean.
I want to open custom file type from applications like File explorer. My intent filter looks like:
[IntentFilter(new[] { Intent.ActionView, Intent.ActionSend, Intent.ActionEdit },
Categories = new[] { Intent.CategoryDefault },
DataMimeType = "*/*",
DataHost = "*",
DataPathPattern = ".*\\.pdo",
Icon = "@drawable/icon"
)]
When I tap on the file in Total Commander, the next popup window appeared:
I could select "Open with" or "Open as", and in the succeeding window select my app. All is OK.
But when I tap on the file in File explorer (Samsung A51), the next popup window appeared:
So the first question is what I missed and how to tell File Explorer to open this file with my app.
And when I tap on the txt-file, the next window appeared:
It would be the better option for my app to be shown in this nice window :) So the 2nd question is how to achieve this behavior. Thank you in advance.
Edit
Here is a relevant part of generated AndroidManifest.xml
<manifest>
<application
android:name="android.app.Application"
android:debuggable="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:requestLegacyExternalStorage="true">
<activity
android:theme="@2131689703"
android:icon="@2131165558"
android:name="MainActivity"
android:launchMode="2"
android:configChanges="0x26c0"
android:alwaysRetainTaskState="true">
<intent-filter android:icon="@2131165558">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="*" />
<data android:pathPattern=".*.pdo" />
<data android:mimeType="application/pdo" />
<data android:mimeType="application/octet-stream" />
</intent-filter>
</activity>
<activity
android:theme="@2131689957"
android:icon="@2131165558"
android:name="SplashActivity"
android:configChanges="0x480"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="xamarin.essentials.fileProvider"
android:exported="false"
android:authorities="de.novel.loadsol.fileProvider"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@2131820550" />
</provider>
</application>
</manifest>
Edit 2
It looks like problem is specific for some devices. On Vivo and Honor phones File explorer opens my app well.