illegal state exception crashes app when switching from Activity to RosActivity
My main activity is a rosActivity where I execute various nodes in my init function. I have an Android activity that displays various utility information and I can switch from my RosActivity to my Activity without any problems. When I return to my RosActivity from my Activity the following error occurs:
W/dalvikvm( 6308): threadid=1: thread exiting with uncaught exception (group=0x40a4b1f8)
E/AndroidRuntime( 6308): FATAL EXCEPTION: main
E/AndroidRuntime( 6308): java.lang.IllegalStateException
E/AndroidRuntime( 6308): at com.google.common.base.Preconditions.checkState(Preconditions.java:129)
E/AndroidRuntime( 6308): at org.ros.android.RosActivity.startMasterChooser(RosActivity.java:115)
E/AndroidRuntime( 6308): at org.ros.android.RosActivity.access$100(RosActivity.java:38)
E/AndroidRuntime( 6308): at org.ros.android.RosActivity$NodeMainExecutorServiceConnection.onServiceConnected(RosActivity.java:58)
E/AndroidRuntime( 6308): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1068)
E/AndroidRuntime( 6308): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1085)
E/AndroidRuntime( 6308): at android.os.Handler.handleCallback(Handler.java:605)
E/AndroidRuntime( 6308): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 6308): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 6308): at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime( 6308): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 6308): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 6308): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime( 6308): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime( 6308): at dalvik.system.NativeStart.main(Native Method)
I'm running on a phone and using a lot of memory so the original RosActivity is almost certainly being destroyed when I switch to my Activity. Are the RosNodes connected to their rosActivity in a way where they cannot be recalled when their RosActivity is destroyed?