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?
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Just tried on a Pixel 5 using the built-in Google Files app. The app appears in the list of options when trying to open a .ged file.
 
Upvote 0

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: 54
  • ged2.png
    ged2.png
    18.7 KB · Views: 43
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
this way works for me:
Tested on Samsung Galaxy S23 FE with Android 14.
My application name is not displayed on .ged files
And if the file is .txt, then is displayed.
Miracles :rolleyes:
 
Upvote 0
Top