java.lang.NullPointerException

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

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web21067

  • via GitHub by wvictor-rr
    , 5 months ago
    Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
  • Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
  • via GitHub by agent4788
    , 1 year ago
    Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
  • Stack trace

    • 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(ContextWrapper.java:90) at android.view.ContextThemeWrapper.getResources(ContextThemeWrapper.java:74) at android.support.v7.app.AppCompatActivity.getResources(AppCompatActivity.java:551) at android.widget.Toast.<init>(Toast.java:122) at android.widget.Toast.makeText(Toast.java:290) at com.example.abhijeetsingh.recievecall.MyReceiver.setData(MyReceiver.java:51) at com.example.abhijeetsingh.recievecall.ServiceReceiver$1.onCallStateChanged(ServiceReceiver.java:37) at android.telephony.PhoneStateListener$2.handleMessage(PhoneStateListener.java:404) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    5 times, 6 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 10 months ago
    Unknown user
    Once, 1 year ago
    2 times, 1 year ago
    4 more bugmates