Hi there:
I have written an app that handles ACTION_VIEW intents for KML files, based on path patterns (see below) but clicking on a KML file just raises an error dialog (Error - cannot open file). Is this because you look up the MIME type to create an ACTION_VIEW intent? And don't have KML in your registry? Or is there something wrong with my Intent filter?
You can use the PackageManager to check whether any Activities can handle a simple URI-based intent, so as to avoid crashes (and circularities, i.e. AndExplorer calling itself).
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:pathPattern=".*\\.kml" />
<data android:host="*" />
</intent-filter>
Regards,
Martin
View action for non-standard file typesRe: View action for non-standard file typesYes, it's because KML is not our registry.
|