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


Solutions on the web

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

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

Solution icon of stackoverflow
via Stack Overflow by Erdem Azaklı
, 1 year ago
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

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

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

Solution icon of web
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

Solution icon of stackoverflow
via Stack Overflow by Cyprien Aubry
, 1 year ago
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

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

Solution icon of stackoverflow
Attempt to invoke virtual method 'android.content.res.Resources<br/> android.content.Context.getResources()' on a null object reference<br/>

Solution icon of stackoverflow
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:87)
	at com.emanager.ui.adapters.HomePagerAdapter.getPageTitle(HomePagerAdapter.java:45)
	at android.support.design.widget.TabLayout.populateFromPagerAdapter(TabLayout.java:773)
	at android.support.design.widget.TabLayout.setPagerAdapter(TabLayout.java:764)
	at android.support.design.widget.TabLayout.setupWithViewPager(TabLayout.java:716)
	at com.emanager.ui.activities.HomeActivity.onCreate(HomeActivity.java:65)
	at android.app.Activity.performCreate(Activity.java:6237)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)

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, 9 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
4 more bugmates