I have made my own filetype (.mmd). This filetype i have saved some data in, and would like, when a file of this type is selected to have it open in my app, in the subactivity called openMeasurement.
My manifest has been altered so the activity has the following properties, which i got from another thread. But it doesn't seem to be enough
<activity android:name="OpenMeasurement">
<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" android:host="*"
android:pathPattern=".*\\.mmd" />
<data android:scheme="https" android:host="*"
android:pathPattern=".*\\.mmd" />
<data android:scheme="content" android:host="*"
android:pathPattern=".*\\.mmd" />
<data android:scheme="file" android:host="*"
android:pathPattern=".*\\.mmd" />
</intent-filter>
</activity>
What am i doing wrong\Forgetting anyone that can help? -Thanks a bunch in advance.
Edit 1:
Might it be because i am only debugging on my real phone and hence not installing and getting all the specific requirements, really shouldn't be like this, I'd like a few comments on it if you think so aswell.
------Edit3---Seems like it does register the "open filetype" on the phone even when in "debug mode", Since i could register it for a .pdf file
Edit 2: Ok i tried to split it up, deleted the HTTP schemes since i deem them unnecessary. Now code looks like this:
<activity android:name="OpenMeasurement">
<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="content" />
<data android:host="*" />
<data android:pathPattern=".*\\.mmd" />
</intent-filter>
<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="file" />
<data android:host="*" />
<data android:pathPattern=".*\\.mmd" />
</intent-filter>
</activity>
And it still doesn't open, nor give the choice too, when i choose my file (using "My Files")
Have also tried using double escapes in pathpattern (".*\\.mmd") didnt help either.
Edit 4: Also tried to add:
<data android:mimetype="*/*"/>
But still no joy :'-(
It isnt doable in the general case, as the intent mechanism is working with MIME types and you can only use the predefined MIME types.
See http://code.google.com/p/android/issues/detail?id=11112
So: You cannot make it work in a local file explorer, like ASTRO, as it probably works as described in ACTION_VIEW intent for a file with unknown MimeType - ie using the build-in MimeTypeMap.
However, if the files are on the web, as the web browser URL opening mechanism can be intercepted, as described in http://groups.google.com/group/android-developers/browse_thread/thread/d79bfa05528cbbee#