Well, first, you want to drop the mimeType attribute, or possibly
merge it into your other <data> element. Right now, you are saying
that you support *both*:

-- all files with any MIME type
-- files with the particular scheme/host/pathPattern of any MIME type

which seems unlikely to be what you want.

(multiple of the same element name in an <intent-filter>, like
multiple <data> elements, is a logical OR)

Beyond that, I don't know what to tell you. I never start activities
via am directly, so I don't know if that is part of your problem.  I
would create a separate activity that calls startActivity() on an
ACTION_VIEW Intent with a candidate Uri and see what happens, rather
than relying upon third party code as your trigger, so you control
things better.

There are certainly people using your style of <intent-filter>, as
this short-URL to a Google Code Search illustrates:

http://goo.gl/2VVul

On Fri, Nov 4, 2011 at 9:18 PM, chrisn <[email protected]> wrote:
> This is *incredibly frustrating.  I have changed my intent-filter to
> look like:
>
> <intent-filter>
>        <action android:name="android.intent.action.VIEW" />
>        <category android:name="android.intent.category.DEFAULT" />
>        <data android:mimeType="*/*"/>
>        <data android:scheme="file" android:host="*"
> android:pathPattern=".*\\.bif"/>
>      </intent-filter>
>
> $ adb shell am start -a android.intent.action.VIEW -d
> file:///mnt/sdcard/UIComposer/basicredcube.bif -n
> com.nvidia.devtech.UICViewer/.UICViewer
> Starting: Intent { act=android.intent.action.VIEW
> cat=[com.nvidia.devtech.UICViewer/.UICViewer] dat=file:///mnt/sdcard/
> UIComposer/basicredcube.bif }
>
> This works fine.
>
> Dropping the -n {explicity component} from the equation fails.
>
> What is going on?
>
> Chris
>
> On Nov 4, 5:26 pm, chrisn <[email protected]> wrote:
>> I am having trouble getting my android system to launch my activity
>> for all files with a given extension.
>>
>> I am using OI File Manager, and trying to get my activity launched for
>> all files with a given suffix (bif).
>>
>> Here is the relevant section of my manifest:
>>
>> <application
>>                         android:icon="@drawable/icon"
>>                         android:label="@string/app_name" >
>>                 <!--We derive from native activity so we can access 
>> information
>>                 about the intent the activity was launched with -->
>>                 <activity android:name="com.nvidia.devtech.UICViewer"
>>                                 android:label="@string/app_name"
>>                                 android:screenOrientation="landscape">
>>                         <!-- Tell NativeActivity the name of or .so -->
>>                         <meta-data android:name="android.app.lib_name"
>>                                         android:value="UICViewer" />
>>                         <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:mimeType="*/*" />
>>                                 <data android:scheme="file"/>
>>                                 <data android:host="*" />
>>                                 <data android:pathPattern=".*\\.bif" />
>>                         </intent-filter>
>>                 </activity>
>>     </application>
>>
>> And here is the output of adb logcat when I 'click' on the file:
>>
>> I/ActivityManager(  145): Starting: Intent
>> { act=android.intent.action.VIEW dat=file:///mnt/sdcard/UIComposer/
>> basicredcube.biftyp=*/* cmp=android/
>> com.android.internal.app.ResolverActivity } from pid 566
>> I/ActivityManager(  145): Displayed android/
>> com.android.internal.app.ResolverActivity: +370ms
>>
>> All that happens is that the screen goes slightly darker than it was
>> and my app doesn't appear.
>>
>> Any thoughts as to why this may be?  Or more thorough ways to debug
>> this?
>>
>> Chris
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to