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

xiaomeng.io | 8 months 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

    Azure Mobile Service Facebook Authentication android client fails

    Stack Overflow | 3 years ago | Rumesh Eranga
    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
  2. 0

    Azure Mobile Service Facebook Authentication android client fails

    xiaomeng.io | 8 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
  3. 0

    Refresh Azure user token in a Service without an activity in android

    Stack Overflow | 1 month ago | Meteo02
    java.lang.ClassCastException: android.app.Application cannot be cast to android.app.Activity
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    How to authenticate Azure Mobile Services in Android Service

    Stack Overflow | 3 years ago | Neil
    java.lang.ClassCastException: *** cannot be cast to android.app.Activity

    Root Cause Analysis

    1. java.lang.ClassCastException

      android.app.Application cannot be cast to android.app.Activity

      at com.microsoft.windowsazure.mobileservices.LoginManager.showLoginUI()
    2. com.microsoft.windowsazure
      MobileServiceClient.login
      1. com.microsoft.windowsazure.mobileservices.LoginManager.showLoginUI(LoginManager.java:282)
      2. com.microsoft.windowsazure.mobileservices.LoginManager.authenticate(LoginManager.java:143)
      3. com.microsoft.windowsazure.mobileservices.MobileServiceClient.login(MobileServiceClient.java:230)
      4. com.microsoft.windowsazure.mobileservices.MobileServiceClient.login(MobileServiceClient.java:214)
      4 frames
    3. com.example.shopindev2
      MainActivity.onCreate
      1. com.example.shopindev2.MainActivity.onCreate(MainActivity.java:31)
      1 frame
    4. Android Platform
      ActivityThread.main
      1. android.app.Activity.performCreate(Activity.java:5133)
      2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
      4. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
      5. android.app.ActivityThread.access$600(ActivityThread.java:141)
      6. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
      7. android.os.Handler.dispatchMessage(Handler.java:99)
      8. android.os.Looper.loop(Looper.java:137)
      9. android.app.ActivityThread.main(ActivityThread.java:5103)
      9 frames
    5. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:525)
      2 frames
    6. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      2 frames
    7. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame