Closed GoogleCodeExporter closed 9 years ago
Ah, I've realized that there is already a hacky way to handle this case (see
showDialogSafely). Unfortunately, this is wrong (and is not used in a few
important cases). The reason it's wrong, because it just fixes a side effect
of bad coding.
According to the docs, we have two ways to fix the original issue:
1) If the confirmation dialog is part of the same activity that started a long
running action, it should be tied to the activity and should be properly
terminated on the activity destuction, e.g. if MyTracks activity starts a track
export, it should cancel it in its onDestroy
2) If the action is to be run regardless whether its creator is destroyed or
not, we should use the global context of the application (which is not tied to
any particular activity).
In both cases, the right fix is to remove showDialogSafely and fix
showMessageDialog and double check all Runnables if they are properly accessing
activities.
Original comment by ba...@google.com
on 8 Nov 2010 at 4:13
There is another instance of this bug:
D/MyTracks( 7296): TrackRecordingService.shutdownAnnouncer: null
E/JavaBinder( 7296): *** Uncaught remote exception! (Exceptions are not yet
supported across processes.)
E/JavaBinder( 7296): java.lang.RuntimeException: Can't create handler inside
thread that has not called Looper.prepare()
E/JavaBinder( 7296): at android.os.Handler.<init>(Handler.java:121)
E/JavaBinder( 7296): at
android.telephony.PhoneStateListener$2.<init>(PhoneStateListener.java:299)
E/JavaBinder( 7296): at
android.telephony.PhoneStateListener.<init>(PhoneStateListener.java:299)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.StatusAnnouncerTask$1.<init>(StatusAnn
ouncerTask.java:76)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.StatusAnnouncerTask.<init>(StatusAnnou
ncerTask.java:76)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.StatusAnnouncerTask.<init>(StatusAnnou
ncerTask.java:89)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.StatusAnnouncerFactory.create(StatusAn
nouncerFactory.java:44)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.TrackRecordingService.setUpAnnouncer(T
rackRecordingService.java:688)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.TrackRecordingService.setAnnouncementF
requency(TrackRecordingService.java:1062)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.PreferenceManager.onSharedPreferenceCh
anged(PreferenceManager.java:134)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.TrackRecordingService.onSharedPreferen
ceChanged(TrackRecordingService.java:623)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.TrackRecordingService$2.sharedPreferen
ceChanged(TrackRecordingService.java:993)
E/JavaBinder( 7296): at
com.google.android.apps.mytracks.services.ITrackRecordingService$Stub.onTransact
(ITrackRecordingService.java:144)
E/JavaBinder( 7296): at android.os.Binder.execTransact(Binder.java:320)
E/JavaBinder( 7296): at dalvik.system.NativeStart.run(Native Method)
D/MyTracks( 7286): MyTracksMap.onSharedPreferenceChanged: announcementFrequency
Original comment by ba...@google.com
on 16 Nov 2010 at 3:47
This is one of the bugs I fixed in my change:
http://code.google.com/r/sandordornbush-bugfix-mac/source/detail?r=fd0e3ae70cd54
8183206da8d9ceb45d6a952ef9d
Original comment by sandordo...@google.com
on 16 Nov 2010 at 4:19
I've fixed both cases, http://code.google.com/r/bartn-mytracks/source/list.
Original comment by ba...@google.com
on 18 Nov 2010 at 7:13
Original issue reported on code.google.com by
ba...@google.com
on 23 Oct 2010 at 5:36