ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

illegal state exception crashes app when switching from Activity to RosActivity

asked 2012-07-02 12:04:36 -0600

dirkmcpherson gravatar image

updated 2014-01-28 17:12:53 -0600

ngrennan gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-07-02 22:29:15 -0600

damonkohler gravatar image

I've created a bug for this: http://code.google.com/p/rosjava/issues/detail?id=123

Feel free to star it so that you will be notified when it is addressed.

edit flag offensive delete link more

Comments

Hi, I got the same problem. Did you solve the problem then??

kevin.kuei.0321@gmail.com gravatar image kevin.kuei.0321@gmail.com  ( 2015-11-12 01:39:25 -0600 )edit

Question Tools

Stats

Asked: 2012-07-02 12:04:36 -0600

Seen: 6,686 times

Last updated: Jul 02 '12