same activity called multiple times code example

Example: same activity called multiple times

Android will recreate your activity after certain "device configuration changes". One such example is orientation. You can read more here... http://developer.android.com/guide/topics/resources/runtime-changes.html

Perhaps something in your threads is doing something which is considered a configuration change?

If that's the case you might find it useful to extend the Application class instead and do your initialization there. See this post... Activity restart on rotation Android

Tags:

Java Example