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 | 1 month ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Need Help in Fragments(Android)

    Stack Overflow | 1 month 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 | 3 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 | 6 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 4 times, last 2 weeks ago
  2. andreeaa marin 184 times, last 1 month ago
  3. Reich 59 times, last 1 month ago
  4. gamebusterz 40 times, last 1 month ago
  5. Emrah Küçük 3 times, last 2 months ago
42 more registered users
11 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