I would like to make an activity be an option to open .json files type. For example, when I click on a .json file in my explorer, I want it to be opened (or to have an option to open it) in this activity. To achieve this, I have tried to add a pathPattern, a scheme and a host to my activity in the manifest. No success. The explorer says "No application to open this file." After searching on StackOverflow, I tried to add mimeType. Still no success. I've tried over 20 different answers from existing StackOverflow questions, without any success. Here's some of the answers I've tried: here, here, here. Here's my activity:
<activity
android:name=".JsonActivity"
android:label="Json">
<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="http" />
<data android:scheme="https" />
<data android:scheme="content" />
<data android:scheme="file" />
<data android:host="*" />
<data android:pathPattern=".*\\.json" />
</intent-filter>
</activity>
What am I doing wrong? I made sure I added the WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions and also the category BROWSABLE and the action VIEW.