java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.salimshivani.student/com.example.salimshivani.student.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

Stack Overflow | Salim Shivani | 3 months ago
  1. 0

    Attempt to invoke virtual method in Resources res = getResources();

    Stack Overflow | 3 months ago | Salim Shivani
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.salimshivani.student/com.example.salimshivani.student.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
  2. 0

    Youtube Player API results in java.lang.NoClassDefFoundError

    codegur.com | 3 months ago
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.salimshivani.student/com.example.salimshivani.student.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
  3. 0

    Android Json Parsing App

    Stack Overflow | 2 years ago | Android007
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    getResources() return an error

    Stack Overflow | 11 months ago | J. Arnold
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
  6. 0

    Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

    Stack Overflow | 11 months ago | Ionut Harcau
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.ionut.simi_word_info/com.example.ionut.simi_word_info.views.allCountry_activity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

    1 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.NullPointerException

      Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

      at android.content.ContextWrapper.getResources()
    2. Android Platform
      ContextThemeWrapper.getResources
      1. android.content.ContextWrapper.getResources(ContextWrapper.java:92)
      2. android.view.ContextThemeWrapper.getResources(ContextThemeWrapper.java:81)
      2 frames
    3. com.example.salimshivani
      MainActivity.<init>
      1. com.example.salimshivani.student.MainActivity.<init>(MainActivity.java:241)
      1 frame
    4. Java RT
      Class.newInstance
      1. java.lang.Class.newInstance(Native Method)
      1 frame
    5. Android Platform
      ActivityThread.performLaunchActivity
      1. android.app.Instrumentation.newActivity(Instrumentation.java:1096)
      2. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122)
      2 frames