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

Stack Overflow | W. Vincent | 3 months ago
  1. 0

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

    Stack Overflow | 3 months ago | W. Vincent
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
  2. 0

    How to pass data on image click from RecycleAdapter to Fragment interface, which I used in MainActivity to show data

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

    Recycler View Item onClick

    Stack Overflow | 6 months ago | Dan Maia
    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

    Android Studio can't find Resuorces

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

    AsyncTask crashes after first line?

    Stack Overflow | 2 years ago
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

  1. maxxi 4 times, last 4 weeks ago
  2. Stefan Braune 6 times, last 6 months ago
  3. Riyaz 1 times, last 6 months ago
  4. asvid 4 times, last 6 months ago
  5. tone5992 2 times, last 7 months ago
2 more registered users
5 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.widget.Toast.<init>()
  2. Android Platform
    Toast.makeText
    1. android.widget.Toast.<init>(Toast.java:102)
    2. android.widget.Toast.makeText(Toast.java:259)
    2 frames
  3. com.example.nkwpy
    MainFragment$queryListener.onClick
    1. com.example.nkwpy.myapplication.MainFragment.query(MainFragment.java:176)
    2. com.example.nkwpy.myapplication.MainFragment.access$000(MainFragment.java:46)
    3. com.example.nkwpy.myapplication.MainFragment$queryListener.onClick(MainFragment.java:161)
    3 frames
  4. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:5207)
    2. android.view.View$PerformClick.run(View.java:21177)
    3. android.os.Handler.handleCallback(Handler.java:739)
    4. android.os.Handler.dispatchMessage(Handler.java:95)
    5. android.os.Looper.loop(Looper.java:148)
    6. android.app.ActivityThread.main(ActivityThread.java:5458)
    6 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
    2 frames