Android Question [Solved] Trying to start my App via click on a specially registerd file

opus

Active Member
Licensed User
Longtime User
I'm trying to start my app by the click on a file (which contains data to be read by the app).
I used following intent filter setting in the manifest editor.

Project manifest:
AddActivityText(Main,
   <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:scheme="content" />
        <data android:mimeType="*/*" />
        <data android:pathPattern=".*\\.dat" />
        <data android:host="*" />
    </intent-filter>)

On a android 4.4.2 device, clicking on a .dat file opens the app, after parsing the path and filename form the intend (or better from the held URI) I can open the file as expected.
On a more android version (9.0 +) the file-extension isn' t registered at all.
I checked in DEBUG mode since the system message ("You don't have an app to open a file of this type" [translated from German!) would also show if the directory could not be reached. IMHO the more recent devices don get that far at all, in other words the file extension is not registered.
 

opus

Active Member
Licensed User
Longtime User
Thanks for the reply, all I can say that it works as posted on Android 4.4.2 but it does not on 9.0+. In other words I don't get an intent on the newer devices, dealing with the uri from an intent would be the next step!
Yes, I did try it with a single scheme as well, same effect.
 
Upvote 0

opus

Active Member
Licensed User
Longtime User
I still can't get a working solution for the android 9.0+ devices.
I created a new project with just the manifest (as posted above, single scheme or both, no difference) and code in the Activity_Resume Sub. The app opens on android 4.4.2 and read the file, the 9.0+ devices just give the system hint "No App for this kind of file".
Am I on the totally wrong way?
 
Upvote 0

opus

Active Member
Licensed User
Longtime User
OK, thanks for the advice.
In this case I move to the ContentChooser, although for this one I have to select the file from within the app.
 
Upvote 0
Top