Am I missing something really dumb.

by Al Sutton » Wed, 04 Feb 2009 21:37:23 GMT


Sponsored Links
 I have a service in an APK which starts a Thread which has the following 
in it's run method;

            Intent intent = new Intent("com.funkyandroid.TEST", dataURI);
            MyService.this.sendOrderedBroadcast(intent, null);

In a different APK I have the following in the application section manifest;

        <receiver    android:name=".Receiver" android:exported="true">
            <intent-filter>
                <action android:name="com.funkyandroid.TEST />
            </intent-filter>
        </receiver>

And in the onRecieve(Context,Intent) method has;

        Log.i("Receiver", "Hello Momma!!!!!");

But the receiver doesn't receive the broadcast when I run it in the 
emulator (or at least the log message doesn't get received).

Any hints?

Al.

-- 
======
Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


--~--~---------~--~----~------------~-------~--~----~



Am I missing something really dumb.

by Peli » Wed, 04 Feb 2009 21:59:40 GMT


 Your intent has a deceptively looking dataURI. Your intent filter
should therefore contain the <type ...> tag with the corresponding
MIME type of the dataURI in order to match.

Peli
www.openintents.org



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Am I missing something really dumb.

by Al Sutton » Thu, 05 Feb 2009 00:13:18 GMT


 dataURI is a content provider URI 
(content://com.funkyandroid.provider.test/) which is created using 
Uri.parse.

I can't see a way to specify a MIME type in Uri.parse or in the 
resulting Uri object, so am I still missing something?

Al.







-- 
======
Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


--~--~---------~--~----~------------~-------~--~----~



Am I missing something really dumb.

by Peli » Thu, 05 Feb 2009 00:25:22 GMT


 In your provider, you should have a method getType(Uri uri) which
returns the MIME type of your Uri.

You should have defined it yourself as something like:
"vnd.android.cursor.dir/vnd.funkyandroid.provider.text"

and this is the MIME type that you have to declare in your intent
filter.

Peli





--~--~---------~--~----~------------~-------~--~----~



Am I missing something really dumb.

by Al Sutton » Thu, 05 Feb 2009 01:15:09 GMT


 nce again you've shown yourself as a genius. It's all working now.

Thanks (again),

Al.

Peli wrote:


--
======
Funky Android Limited is registered in England & Wales with the
company number 6741909. The registered head office is Kemp House,
152-160 City Road, London, EC1V 2NX, UK.

The views expressed in this email are those of the author and not
necessarily those of Funky Android Limited, it's associates, or it's
subsidiaries.


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Geocoder.getFromLocation seem to be blocking the UI thread

Hello,

The Geocoder.getFromLocation(double,double) method seems to be blocking the
UI thread even though I created the instance in another thread and then call
the method getFromLocation from a different thread.

any help is appreciated.

Agus.

--~--~---------~--~----~------------~-------~--~----~

2. more than 3 virtual screens?

Quick newbie question.  What are my options for adding more than the
standard default of three virtual screens on cupcake?

Thanks


--~--~---------~--~----~------------~-------~--~----~

3. Porting android on OMAP

4. Huge quert and sorting update of content provider

5. How can I know who started(bind) service?

6. why my getCheckedRadioButtonId() always return a wrong value.

7. connecting internet through Android Emulator