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

Stack Overflow | hamster | 4 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Need Help in Fragments(Android)

    Stack Overflow | 4 months ago | hamster
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.adi.fragment2/com.example.adi.fragment2.MainActivity}: java.lang.ClassCastException: com.example.adi.fragment2.MainActivity cannot be cast to android.app.Activity
  2. 0

    android.os.DeadObjectException HATASI :( | Geleceği Yazanlar

    com.tr | 6 months ago
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.PAKET ADI.1234PRO/com.PAKET ADI.MainActivity}: java.lang.RuntimeException: Package manager has died
  3. 0

    GoogleApiClient.Builder.enableAutoManage() giving me an error

    Stack Overflow | 8 months ago | McFiddlyWiddly
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.googlelogin/com.example.android.googlelogin.MainActivity}: java.lang.ClassCastException: com.example.android.googlelogin.MainActivity cannot be cast to com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    method getInputStream() in HttpURLConnection in Android always failed

    Stack Overflow | 4 years ago | user1842061
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.network/com.example.network.MainActivity}: android.os.NetworkOnMainThreadException

  1. Indri Yunita 7 times, last 2 months ago
  2. andreeaa marin 184 times, last 3 months ago
  3. Reich 59 times, last 4 months ago
  4. gamebusterz 42 times, last 1 month ago
  5. Emrah Küçük 3 times, last 4 months ago
42 more registered users
14 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.RuntimeException

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

    at android.app.ActivityThread.performLaunchActivity()
  2. Android Platform
    ActivityThread.handleLaunchActivity
    1. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2548)
    2. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
    2 frames