help about SMS BroadcastReceiver conflict with GPS LOCATION_SERVICE

by Kevin AN » Mon, 02 Mar 2009 11:24:49 GMT

Sponsored Links
 code is here:
public void onReceive(Context context, Intent intent)
                LocationManager lm = (LocationManager) context.getSystemService

                loc = lm.getLastKnownLocation("gps").toString();

                PendingIntent dummyEvent = PendingIntent.getBroadcast(context, 
new Intent(""), 0);
                mng.sendTextMessage(addr, null, loc, dummyEvent, dummyEvent);


the problem is:
sendTextMessage work well when the two above line is commented. but
when the two line is uncommented, sendTextMessage will trigger a null
point exception!
I think this issue is because the first line
(context.getSystemService) modify the state of "context".
so , can anyone help me?


Other Threads

1. cliq dituntut 

Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to

To request to subscribe to this group:


2. How to extract .properties files from third-party jar to apk file?

No one met such problems?

Currently, I have to make some change to the, and to generate the result as expected.
But I'm afraid this is not the best solution for it might have
systematic impact.


3. How to extract the .properties files in a third party jar file to apk file

4. How to show a 'Progress View' during a ListView is loading

5. Button is not clicking. OnClick Listener not being triggered.

6. onDraw() being called multiple unintended times

7. Calculating text lenght