Replies: 4 comments 1 reply
-
Something like: https://developer.android.com/reference/androidx/core/content/FileProvider might be what you are looking for. Basically you are registering a uri "type" that your app will handle(AndroidManifest) when open/edit etc is used, depending on your app. See the Google docs for the specifics. |
Beta Was this translation helpful? Give feedback.
-
You need to edit the intent filters your application's main activity can receive. This intent filter determines what system intents you will appear for. Eg to receive a pdf file: <activity>
<!-- default launch filter (do not remove) -->
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
<!-- intent to receive pdf files -->
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT"/>
<data android:scheme="content" />
<data android:mimeType="application/pdf" />
</intent-filter>
</activity>
You will need to research the values for the filter for your particular case. |
Beta Was this translation helpful? Give feedback.
-
Since de last update of Android 13 on Pixel 7 Pro, it doesn't work. |
Beta Was this translation helpful? Give feedback.
-
Android can be and is so confusing to noobs like me... @marchbold's solution actually works but it has it limitations depending on which file browser app you're using. As I understand, in order the app to be considered to open specific file type from file browser, it depends on the way file browser parse app's I tried it on Xiaomi 12 Lite and with ES File Commander my app is offered, and with default File Manager my app isn't offered, but if I long press file and choose "More > Open in another app" my app is offered. And AIR's So, here's my findings after two days of researching (tested od Lenovo Yoga tablet, Huawei P10 and Xiaomi 12 Lite (Android 4.4.2, 9 and 14)):
|
App_B is registered to open custom extension file name and when it gets IntentEvent, just read filename and parse arguments from it:
|
Beta Was this translation helpful? Give feedback.
-
I had files for example 'file.swf'. While opening the file from file manager, file manager should popup my app in the popup list.
And how to get the selected file details in my app.
How it is possible?
Beta Was this translation helpful? Give feedback.
All reactions