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. General Activity Order Question

First I have my app running currently and its working fine, I just
question how I implemented it.  I come from a linear C++ background
and this Activity/Intent thing is a little new to me.  Here is how my
app works currently (order of activities started) ("->" = Starts
Activity, "<-" = Returns from activity)

MainActivity
-> Login Activity
<- onActivityResult
function displayListOfItems
...

I am wondering if I should switch the starting intent as follows:

LoginActivity
MainActivity
function displayListOfItems
...

The issue I had with the second scenario was that pressing the back
hard key would take me from the MainActivity back to the LoginActivity
and I didn't like this.  I guess to sum up my question, is it normal
for the MainActivity to handle all subsequent starting of activities
or is it common to do a more linear implementation?

--G

-- 

2. make application should support all versions and screens




No need to bother with multiple app versions for different platforms. Make
the minSdk=3 and the newer attributes that apply to screen sizes should
simply be ignored.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 

3. Custom HomeScreen - Please help

4. ada androider surabaya yang bisa bantu ane root spica ane gak? :) pleaseeee

5. ListView inside Layout with Scrol

6. 1 Sync adapter, multiple quick contact entries

7. image compression