On Sat, Feb 28, 2009 at 11:25 PM, Kevin AN <any...@gmail.com> wrote: > > code is here: > public void onReceive(Context context, Intent intent) > { > LocationManager lm = (LocationManager) context.getSystemService > (Context.LOCATION_SERVICE); > > loc = lm.getLastKnownLocation("gps").toString(); > > PendingIntent dummyEvent = PendingIntent.getBroadcast(context, > 0, > new Intent("com.xxx.xxx.IGNORE_ME"), 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?
Why do you think that the first line modifies the state of context and that that causes a null pointer exception later? Can you post the full stack trace of the exception? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---