So, I've implement sync mechanism, that uses Runnable
.
The thing with Runnable is, that you have to make sure it's properly created and destroyed in Activity
. What happens if you have alot of activities? - Alot of boilerplate code.
Is there a way to create a single instance Runnable for whole application?
Is it okay to initialize it in SomeClass extends Application
as its app entry point? If so, how would one solve cases as such: SomeClass.onCreate()
will hit even if user receives notification (that would also mean, that sync happens every time user gets a notification - which is terrible).