libraryexamples
license
Correction
On second thought, come back to Vector. The problem: before we had the potentially blocking function 'effectFinished' inside our synchronized block.
Improve EffectMessageSender: ArrayList with explicit locking in place of a Vector.
1) add missing call to BlockController.onPause() / onResume() to the Tutorial activity2) rearrange BlockController's error reporting to make the case where the MessageSender thread has died separate3) in such case, resurrect the thread4) simplify and harden the EffectMessageSender
More debugs to the EffectMessageSender.
Firebase shows that we have a problem when an app is rapidly restarted, i.e. when is it paused and resumes within tens of milliseconds. Then sometimes the EffectMessageSender thread dies.
Attempt to limit this by synchronizing the whole 'start' and 'stop' methods, although I suspect this will still happen because the very methods are probably in such case called in the wrong order.
Some more debugs for the case when the UI is blocked.
Fix for a crash when exiting an app:
Activity.onPause() -> MessageSender.stopSending sets mThis to null, then a last message gets sent and a crash in newMessage().
Fix this by
1) making the Message inner class static (so that we can create a new one without a reference to mThis)...
Simplify a bit the place where we got a crash once.
View revisions
Also available in: Atom