0

I'm doing everything to register my activity to respond to a a file with extension .wcd and I've done this but it's not being received when i try to share it this is my code so far..

<activity
        android:name="package.app.activity"
        android:exported="true"
        android:label="@string/title_activity_name" >
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />

            <data android:scheme="file" />
            <data android:mimeType="*/*" />
            <data android:pathPattern=".*\\.wcd" />
            <data android:pathPattern=".*\\..*\\.wcd" />
            <data android:pathPattern=".*\\..*\\..*\\.wcd" />
            <data android:pathPattern=".*\\..*\\..*\\..*\\.wcd" />
            <data android:host="*" />
        </intent-filter>
    </activity>

all I'm trying to do is let my activity respond to all files with extension .wcd so I can use it,despite it's source.. I've searched for other questions and I don't know why mine does not work, am I leaving something out, or is there something I'm not doing, I've also read the documentation that's why I even added

android:exported="true"

any bail out?? thanks in advance for help..

pah
  • 4,700
  • 6
  • 28
  • 37
  • possible duplicate of [Android intent filter: associate app with file extension](http://stackoverflow.com/questions/3760276/android-intent-filter-associate-app-with-file-extension) – QuinnG Oct 03 '14 at 22:17
  • @Nija i know it sounds like a duplicate, but how different is my code from that answer, i've seen that answer but its not working for me..thats why i posted a new question –  Oct 03 '14 at 22:22
  • Dupe due to asking the same thing - Additional point is that the mime type is wrong. See [here](http://developer.android.com/guide/topics/manifest/data-element.html) Specifically `The subtype can be the asterisk wildcard (*) to indicate that any subtype matches.` – QuinnG Oct 03 '14 at 22:24
  • rili? won't that give me manisfest malformed?? from the doucmentation it states An asterisk ('*') matches a sequence of 0 to many occurrences of the immediately preceding character... so i dont rili get you... can you please re-write the mime aspect you talking about?@Nija –  Oct 03 '14 at 22:43
  • I guess I'll take a step back and ask, Did you try the 3rd example from the possible duplicate I linked? – QuinnG Oct 03 '14 at 23:05
  • i believe i have mixed all the answers, the first,second and third example.. im very suprised myself its not working..because all working answers doesnt differ from mine@Nija –  Oct 03 '14 at 23:14

1 Answers1

0

Pulled directly from Android intent filter: associate app with file extension and changed pdf to wcd.

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="file" />
            <data android:host="*" />
            <data android:pathPattern=".*\\.wcd" />
        </intent-filter>

and it works for me.

Community
  • 1
  • 1
QuinnG
  • 6,346
  • 2
  • 39
  • 47