Receiving broadcast null in application shutdown

by Semeria Stefano » Tue, 13 May 2008 10:27:50 GMT


Sponsored Links
 ello,

My application is using a mocked location provider and an intent receiver to
receive updates.
During shutdown I first stop the location updates with
LocationManager.removeUpdates(), then I deregister the intent receiver.

I randomly receive the following error:

I/jade.util.Logger( 1101): com.tilab.msn.LocationReceiver: onReceiveIntent
called: My currentThread has this ID: 1 -> Intent receiver has called
I/jade.util.Logger( 1101): com.tilab.msn.ContactListActivity: onStop called ...
I/jade.util.Logger( 1101): com.tilab.msn.GeoNavigator: Stopping location
updates.... -> Here updates should be stopped!
D/LocationManager( 1101): removeUpdates: intent = Intent {
action=com.tilab.msn.LOCATION_UPDATE }
D/LocationManagerService( 508): removeUpdate: intent = Intent {
action=com.tilab.msn.LOCATION_UPDATE }
D/LocationManagerService( 508): loadProviders
D/LocationManagerService( 508): loadProviders: already loaded
I/jade.util.Logger( 1101): com.tilab.msn.ContactListActivity: onDestroy called
...
I/jade.util.Logger( 1101): com.tilab.msn.GeoNavigator: Unregistering the intent
receiver.... -> Here I deregister the intent receiver
I/jade.util.Logger( 1101): jade.android.MicroRuntimeService: Initiating
Stopping JADE...
I/jade.util.Logger( 1101): jade.core.FrontEndContainer: Container shut down
activated
I/jade.util.Logger( 1101): com.tilab.msn.MsnAgent: Starting agent takeDown()
I/jade.util.Logger( 1101): com.tilab.msn.MsnAgent: DS Subscription Canceling
message was sent!
I/jade.util.Logger( 1101): com.tilab.msn.MsnAgent: Deregistering from DF!
D/jade.util.Logger( 1101): jade.core.FrontEndContainer: Local agents terminated
I/jade.util.Logger( 1101): jade.imtp.leap.JICP.BIFEDispatcher: Sending
termination notification
D/jade.util.Logger( 1101): jade.core.FrontEndContainer: Connection manager
closed
I/jade.util.Logger( 1101): jade.android.MicroRuntimeService: JADE should be
stopped now! Microruntime.shutdownJADE() ends!
D/jade.util.Logger( 1101): jade.android.JadeGateway: disconnect():
disconnecting from service
W/ActivityManager( 508): Unbind failed: could not find connection for [EMAIL
PROTECTED]
I/jade.util.Logger( 1101): com.tilab.msn.LocationReceiver: onReceiveIntent
called: My currentThread has this ID: 1 -> Intent receiver has called again!!!
I/jade.util.Logger( 1101): com.tilab.msn.LocationReceiver: onReceiveIntent
called: My currentThread has this ID: 1
I/jade.util.Logger( 1101): com.tilab.msn.LocationReceiver: onReceiveIntent
called: My currentThread has this ID: 1
W/ActivityManager( 508): finishReceiver called but no pending broadcasts
D/dalvikvm( 1101): Exception Ljava/lang/RuntimeException; from
ActivityThread.java:492 not caught locally
D/dalvikvm( 1101): Exception Ljava/lang/RuntimeException; from
ZygoteInit.java:1553 not caught locally
D/AndroidRuntime( 1101): Shutting down VM
W/dalvikvm( 1101): threadid=3: thread exiting with uncaught exception
(group=0x4000fdf8)
E/AndroidRuntime( 1101): Uncaught handler: thread Main exiting due to uncaught
exception
E/AndroidRuntime( 1101): java.lang.RuntimeException: Error receiving broadcast
null in [EMAIL PROTECTED]
...

It seems that the service that stops the updates is not doing it synchronously,
so updates continues for a while after the LocationManager.removeUpdates() call
returns. If this is the right behavior, I guess that I should wait before
deregistering the intent receiv



Receiving broadcast null in application shutdown

by Megha Joshi » Wed, 14 May 2008 18:26:59 GMT


 i Stefano,

This seems like a bug. Could you please log this with enough details in the
android issue tracker?

This has been discussed earlier in the thread below:
http://groups.google.com/group/android-developers/browse_thread/thread/d03f0db6004345a1/35346fa13547133f

Thanks,
Megha

On Tue, May 13, 2008 at 3:27 AM, Semeria Stefano <
[EMAIL PROTECTED]> wrote:


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


Sponsored Links


Receiving broadcast null in application shutdown

by geekchique » Wed, 14 May 2008 20:15:53 GMT


  would love to hear any work arounds for this I have been struggling
with this for an age without realising its a bug!


On May 13, 10:27am, Semeria Stefano
<[EMAIL PROTECTED]> wrote:
--~--~---------~--~----~------------~-------~--~----~



Receiving broadcast null in application shutdown

by Mark Murphy » Wed, 14 May 2008 20:36:01 GMT


 > I would love to hear any work arounds for this I have been struggling

With M5, I haven't run into this bug, but it may be that my usage of
location updates differs from the ones that are getting the bug.

I get the updates in an activity (vs. a service). I turn off updates in
onPause() and resume them in onResume(), since in my case I don't need the
updates if the activity isn't visible.

I turn off updates using:

myLocationManager.removeUpdates(myIntent);
unregisterReceiver(intentReceiver);

where intentReceiver and myIntent are instance variables in the activity
itself.

It may be that I'm "immune" to the bug in that the time gap between
onPause() and my activity being destroyed is too long to trigger the bug.
Near as I can tell from the referenced thread, the issue is that the
IntentReceiver is no longer around when the last update or two get sent;
in my case, my IntentReceiver probably is around long enough to get those
last updates.

So, as far as a workaround, try to keep your IntentReceiver around after
disabling updates. This may mean disabling updates earlier than you are
doing now, or it may be your IntentReceiver is somehow going out of scope
and is getting garbage collected earlier than is necessary.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
The Busy Coder's Guide to Android Development -- coming in June 2008!


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



Other Threads

1. How to highlight list item

Hi All,

Can any one tell me how can I highlight any item of my list when mouse
cursor passes through that particular item. Is this possible to
highlight any particular option/item using soft keys??????

If yes, please tell me how it can be done??????

Thnx

-- 

2. Fwd: Dijual HTC Tattoo (Android Phone) komplit dan kinyis-kinyis

Maaf repost, drop price 3.999 rb --> 3.850 rb biar cepet laku. Info detil
dan poto klik link dibawah ini

http://wp.me/pdhUB-4X

Thanks

SyamSyah

---------- Forwarded message ----------
From: SyamSyah Milis <syamsyah.mi...@gmail.com>
Date: Nov 17, 2009 10:15 AM
Subject: Dijual HTC Tattoo (Android Phone) komplit dan kinyis-kinyis
To: gadtor...@yahoogroups.com, iklangad...@yahoogroups.com

As subject dijual dengan kondisi :


   - Mulus 99% masih kinyis-kinyis
   - Asesoris lengkap/komplit
   - Blom pernah rusak/service n semua masih fungsi normal
   - Batere masih normal

Kelengkapan masih komplit semua :

   - Unit dan batere
   - Kardus
   - Charger
   - Kabel data
   - Headset
   - Buku quick start guide
   - Buku dan lembaran lainnya
   - Memori 2 Gb

Untuk info detil dan poto, klik link dibawah ini

http://wp.me/pdhUB-4X

Harga 3.999 rb (nego tipis yaa)

Kontak/SMS: 08113405686
Email: syams...@gmail.com

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

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

3. How many 1.1 devices are still out there?

4. Create database on sd card?

5. "cannot find symbol" error when build CTS after update few source code

6. screen compatibility not quite right

7. Custom Dialog example may be incorrect