Hi i am trying to write an application which deals with “.p12” files
In the following code i have imposed a restriction that for file scheme you can open with my app only if it is of type “.p12”.
This works fine but when i email the “.p12” file and try to open it .
It does’t open with my app because in content scheme i have restricted it to “.p12” and when your email comes the attachment is extended with some more values.
In order to overcome this error i have removed the restriction in content scheme but if i do so when i click on my contact it is asking whether i have to open it using my app or view contacts which is not a good behaviour so how to check the email type and open the “.p12” format using my app.
I think the change is minor and mostly with android:mime type but not able to figure out.
<intent-filter>
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.p12" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<data android:scheme="content" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.p12"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
in content scheme solves the problem.