5

I'm currently writing an Android App and it should open Files with the ending .meetme

Actually it should open them directly from Gmail, but I don't think that is possible.

This is the Code of my AndroidManifest.xml:

<activity android:name=".MeetingRequest" android:label="Meeting Request">
    <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:mimeType="*/*" />
        <data android:host="*" />
        <data android:pathPattern=".*\\.meetme" />
    </intent-filter>
</activity>

I've tried quite a few variations, if I open the file in Astro wit h a long click and open as text, my app shows up and can open it normally. Would be grateful for any help.

Markus

Markus
  • 295
  • 4
  • 12
  • What are you trying to do with the file? read its raw data or display it to a user? – ahodder Jan 12 '11 at 23:58
  • @user551380: First, you have not asked a question. Second, Android works much better based on MIME types than file extensions. – CommonsWare Jan 13 '11 at 01:42
  • Hey, I'm reading the raw data, that part works. My question was how to associate the filetype ".meetme" with my activity, because this version here does not work. Thanks for your comments. – Markus Jan 13 '11 at 10:14

1 Answers1

5

After a lot of trial and error and reading nearly everything I could find, here's what finally worked for me:

    <activity android:name=".DrawActivity"
              android:screenOrientation="portrait"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <action android:name="android.intent.action.EDIT"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:pathPattern="*.snowdragon"/>
            <data android:mimeType="text/snowdragon"/>
        </intent-filter>
    </activity>
Octabode
  • 359
  • 1
  • 4