java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.xxxx/com.example.xxxx.MainActivity}: java.lang.ClassCastException: com.example.xxxx.MainActivity cannot be cast to android.app.Activity

Stack Overflow | Mark James | 2 weeks ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Android Time Picker Pop up issue

    Stack Overflow | 2 weeks ago | Mark James
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.xxxx/com.example.xxxx.MainActivity}: java.lang.ClassCastException: com.example.xxxx.MainActivity cannot be cast to android.app.Activity
  2. 0

    Android emulator "Unfortunately hello world has stopped "

    Stack Overflow | 3 years ago | user3572787
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zezanje/com.example.zezanje.MainActivity}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
  3. 0

    Pass a parameter from a text box

    Stack Overflow | 3 years ago | user2808099
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.App/com.example.App.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Android RuntimeException: Unable to instantiate activity

    Stack Overflow | 3 years ago | user2781812
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.jsonapp/com.example.jsonapp.GetWeather}: java.lang.ClassCastException: com.example.jsonapp.GetWeather cannot be cast to android.app.Activity
  6. 0

    Application fails to start once onClickListener is set

    Stack Overflow | 3 years ago | Ilja
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.braintraininggame.app/com.example.braintraininggame.app.MainActivity}: java.lang.NullPointerException

  1. Donsy 4 times, last 3 weeks ago
  2. Adrien 2 times, last 3 weeks ago
  3. rp 1 times, last 2 months ago
  4. Indri Yunita 74 times, last 2 months ago
  5. mhicauber 2 times, last 3 months ago
75 more registered users
20 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassCastException

    com.example.xxxx.MainActivity cannot be cast to android.app.Activity

    at android.app.Instrumentation.newActivity()
  2. Android Platform
    ActivityThread.main
    1. android.app.Instrumentation.newActivity(Instrumentation.java:1095)
    2. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3083)
    3. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
    4. android.app.ActivityThread.access$1100(ActivityThread.java:221)
    5. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
    6. android.os.Handler.dispatchMessage(Handler.java:102)
    7. android.os.Looper.loop(Looper.java:158)
    8. android.app.ActivityThread.main(ActivityThread.java:7224)
    8 frames
  3. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  4. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    2 frames