Android Question To open with

Sergey_New

Well-Known Member
Licensed User
Longtime User
How do I tell device that text files with a .ged extension should be opened by my app?
 

Sergey_New

Well-Known Member
Licensed User
Longtime User
I did the following, adding the line <data android:scheme="content" />:
B4X:
AddActivityText(Main,
  <intent-filter>
  <action android:name="android.intent.action.MAIN"/>
  <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:mimeType="*/*"/>
  <data android:pathPattern=".*\\.ged" />
  </intent-filter>
)
Now my application name appears in "Open with". In this case, the application opens both .ged files and unregistered file extensions in the application.
What can be done to exclude files with unregistered extensions?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
with unregistered extensions?
You should always create a new thread for any new question. Posting one question after the other is the wrong way in this forum.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
this way works for me:

B4X:
AddActivityText(Main,
<intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
          <data android:mimeType="*/*" />
          <data android:pathSuffix="\\.ged" />
        <data android:host="*" />       
</intent-filter>)


tested on android 12 and 14 with standard file manager
 

Attachments

  • ged1.png
    ged1.png
    12.6 KB · Views: 5
  • ged2.png
    ged2.png
    18.7 KB · Views: 6
Upvote 0
Top