java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.admin.myapplication/com.example.admin.myapplication.MainActivity}: java.lang.ClassCastException: android.app.Application cannot be cast to com.example.admin.myapplication.ApplicationContext

Stack Overflow | sumit | 4 months ago
  1. 0

    android get application context from anywhere but its always show class cast exeption i dont knoew how to use

    Stack Overflow | 4 months ago | sumit
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.admin.myapplication/com.example.admin.myapplication.MainActivity}: java.lang.ClassCastException: android.app.Application cannot be cast to com.example.admin.myapplication.ApplicationContext
  2. 0

    java.lang.RuntimeException: Unable to start activity ComponentInfo{...}:java.lang.ClassCastException: android.app.Application cannot be cast to

    Stack Overflow | 4 years ago | Sergio Picheo
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mobile/com.example.mobile.RecognitionActivity}: java.lang.ClassCastException: android.app.Application cannot be cast to microsoft.hawaii.sampleappbase.HawaiiBaseApplication
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    android run time error in program,unable to solve this

    Stack Overflow | 2 years ago | user3917020
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ni/com.example.ni.DemomediaprojectActivity}: java.lang.ClassCastException: android.app.Application cannot be cast to com.example.ni.CommonClass
  5. 0

    Azure Mobile Service Facebook Authentication android client fails

    xiaomeng.io | 5 months ago
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.shopindev2/com.example.shopindev2.MainActivity}: java.lang.ClassCastException: android.app.Application cannot be cast to android.app.Activity

    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

      android.app.Application cannot be cast to com.example.admin.myapplication.ApplicationContext

      at com.example.admin.myapplication.MainActivity.onCreate()
    2. com.example.admin
      MainActivity.onCreate
      1. com.example.admin.myapplication.MainActivity.onCreate(MainActivity.java:70)
      1 frame
    3. Android Platform
      ActivityThread.performLaunchActivity
      1. android.app.Activity.performCreate(Activity.java:5933)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
      3 frames