Exception or error: I’m struggling to find documentation for the TimerTask function on Android. I need to run a thread at intervals using a TimerTask but have no idea how to go about this. Any advice or examples would be greatly appreciated. How to solve: You use a Timer, and that automatically creates a new …
Tag: time
Android Instant Run First-time takes too much time to launch app after installed-ThrowExceptions
Exception or error: I have installed android-instant-run introduced in android-studio-2.0 I am getting problem while running my app first time. Its appearing with blank screen for a 5 to 10 seconds then after launching activity. It takes time to run first time only for every application but why it happens that I don’t know. Logcat …
Sync Android devices via GPS time?-ThrowExceptions
Exception or error: Short version: Problem: I need several Android devices to do something at the exact same time (within ca 100 milliseconds). For example, I want all devices to play a certain sound at previously determined point in time. Question: Could I use GPS time to make sure the devices clock’s are synced? Longer …
android – App crashes when restoring from background after a long time-ThrowExceptions
Exception or error: My application crashes after idling for a long time in the background. I debugged and found the reason that it is crashing is due to a NullPointerException. Exception was due to the fact that the data in the application singleton class is destroyed by the garbage collector when application is in background. …
android – How to schedule background job at specific time in react native-ThrowExceptions
Exception or error: I want to execute some Task T at specific time in a day in background in react native. I see that it is possible in android as of now using Headless JS. I found that this library implemented this https://github.com/vikeri/react-native-background-job and allows you to execute stuff in background. This is not completely …
java – In Activity.onCreate(), why does Intent.getExtras() sometimes return null?-ThrowExceptions
Exception or error: This was probably a false alarm, see my own answer. Original question below: An activity has a button that takes the user to another activity. To launch the new activity, we populate our Intent with extras, and onCreate(), the new activity reads from those extras via Intent.getExtras(). We assumed the returned bundle …
android – SharedPreferences are sometimes deleted-ThrowExceptions
Exception or error: My app uses SharedPreferences (with the help of a PreferenceActivity) to store all settings. But sometimes all settings are deleted and all values are set back to default. Mostly on Android 3.x tabs. On normal smartphones there are no problems. I have observed that all settings are deleted when the application process …