0

I have got this logcat error more then one time. This time I started a new Activity from a non-Activity subclass. The new Activity that starts is empty, so it has nothing with the content to do.

Here are the logcat lines:

01-14 11:11:03.562: ERROR/AndroidRuntime(299): Uncaught handler: thread main exiting due to uncaught exception
01-14 11:11:03.702: ERROR/AndroidRuntime(299): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.JDL.Apps.Snake/com.JDL.Apps.Snake.SettingsScreen}: java.lang.ClassCastException: com.JDL.Apps.Snake.SettingsScreen
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at android.os.Looper.loop(Looper.java:123)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at android.app.ActivityThread.main(ActivityThread.java:4363)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at java.lang.reflect.Method.invokeNative(Native Method)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at java.lang.reflect.Method.invoke(Method.java:521)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at dalvik.system.NativeStart.main(Native Method)
01-14 11:11:03.702: ERROR/AndroidRuntime(299): Caused by: java.lang.ClassCastException: com.JDL.Apps.Snake.SettingsScreen
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
01-14 11:11:03.702: ERROR/AndroidRuntime(299):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
Rob
  • 45,296
  • 24
  • 122
  • 150
SlowDeepCoder
  • 864
  • 3
  • 11
  • 27

1 Answers1

1
 Caused by: java.lang.ClassCastException: com.JDL.Apps.Snake.SettingsScreen 01-14 11:11:03.702: ERROR/AndroidRuntime(299):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 

In short you have a class cast exception.

Sergey Benner
  • 4,421
  • 2
  • 22
  • 29
  • 1
    it means that you don't have compatible objects to cast or passing a wrong type of object as a parameter there which is most likely. We need to see that Instrumentation.java line 1021 – Sergey Benner Jan 14 '12 at 12:58
  • you need to provide the code as i wrote it in my previous comment mate. – Sergey Benner Jan 14 '12 at 18:42