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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Newbie009
, 11 months ago
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
via Stack Overflow by Xaloju
, 1 year ago
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
via GitHub by thunter1000
, 1 year ago
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
via codegur.com by Unknown author, 1 year ago
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
via GitHub by aamarcha
, 11 months ago
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
via GitHub by BishopGIS
, 2 years ago
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.view.ViewConfiguration.get(ViewConfiguration.java:389)
at android.view.View.(View.java:4064)
at android.view.View.(View.java:4188)
at android.widget.ImageView.(ImageView.java:150)
at android.widget.ImageView.(ImageView.java:145)
at com.android.volley.toolbox.NetworkImageView.(NetworkImageView.java:61)
at com.android.volley.toolbox.NetworkImageView.(NetworkImageView.java:57)
at com.android.volley.toolbox.NetworkImageView.(NetworkImageView.java:53)
at com.mhcasia.android.fragment.HomeFragment.refreshBanners(HomeFragment.java:244)
at com.mhcasia.android.fragment.HomeFragment.access$000(HomeFragment.java:49)
at com.mhcasia.android.fragment.HomeFragment$1.onReceive(HomeFragment.java:77)
at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:297)
at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7329)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Users with the same issue

2 times, 2 months ago
13 times, 1 year ago
Once, 2 years ago
Samebug visitor profile picture
Unknown user
2 times, 7 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.