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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by kavya
, 11 months ago
Unable to instantiate activity ComponentInfo{com.example.pmap.wifitoast/com.example.pmap.wifitoast.MainActivity}: java.lang.ClassCastException: com.example.pmap.wifitoast.MainActivity cannot be cast to android.app.Activity
via Stack Overflow by topher
, 7 months ago
Unable to instantiate activity ComponentInfo{com.example.jackreynaldo.tab/com.example.jackreynaldo.tab.no}: java.lang.ClassCastException: com.example.jackreynaldo.tab.no cannot be cast to android.app.Activity
via Stack Overflow by akkie4396
, 2 years ago
Unable to instantiate activity ComponentInfo{com.pixalstudio.navigationdrawer/com.pixalstudio.navigationdrawer.LocationSelection}: java.lang.ClassCastException: com.pixalstudio.navigationdrawer.LocationSelection cannot be cast to android.app.Activity
via Stack Overflow by user3560827
, 1 year ago
Unable to instantiate activity ComponentInfo{com.mypackage.myapp/com.mypackage.myapp.Fragment_02}: java.lang.ClassCastException: com.mypackage.myapp.Fragment_02 cannot be cast to android.app.Activity
via Stack Overflow by Siddhartha rao
, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.srk97c.elixir/com.example.srk97c.elixir.CameraService}: java.lang.ClassCastException: com.example.srk97c.elixir.CameraService cannot be cast to android.app.Activity
via Stack Overflow by Unknown Code
, 1 year ago
Unable to instantiate activity ComponentInfo{technologies.mirage.prigovdirectory/technologies.mirage.prigovdirectory.MinNumResults.MySearchableActivity}: java.lang.ClassCastException: technologies.mirage.prigovdirectory.MinNumResults.MySearchableActivity cannot be cast to android.app.Activity
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.pmap.wifitoast/com.example.pmap.wifitoast.MainActivity}: java.lang.ClassCastException: com.example.pmap.wifitoast.MainActivity cannot be cast to android.app.Activity
at android.app.Instrumentation.newActivity(Instrumentation.java:1089)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2240)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)
at android.app.ActivityThread.access$800(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)

Users with the same issue

21 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.