java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.sharath.imageapp/com.example.sharath.imageapp.Imagelist}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' 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 Jacksparrow
, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.sharath.imageapp/com.example.sharath.imageapp.Imagelist}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
via Stack Overflow by Sajal Mittal
, 2 years ago
Unable to instantiate activity ComponentInfo{com.mycompany.mypackage/com.mycompany.mypackage.MapsActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
via Stack Overflow by Georgi Koemdzhiev
, 2 years ago
Unable to instantiate activity ComponentInfo{koemdzhiev.com.eggyegg/koemdzhiev.com.eggyegg.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
via Stack Overflow by Beuhbounnet
, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.florian.fessee/com.example.florian.fessee.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
via Stack Overflow by MalumAtire832
, 2 years ago
Unable to instantiate activity ComponentInfo{nl.knapper_development.www.jrw/nl.knapper_development.www.jrw.instelling}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
via Stack Overflow by Prasenjit Hiwale
, 1 year ago
Unable to instantiate activity ComponentInfo{com.antherx.prasenjit.ihdfbachatgat/com.antherx.prasenjit.ihdfbachatgat.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.sharath.imageapp/com.example.sharath.imageapp.Imagelist}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
at android.content.ContextWrapper.getPackageName(ContextWrapper.java:132)
at android.content.ComponentName.(ComponentName.java:77)
at android.content.Intent.(Intent.java:4161)
at com.example.sharath.imageapp.Imagelist.(Imagelist.java:57)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1606)
at android.app.Instrumentation.newActivity(Instrumentation.java:1066)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year 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
10 more bugmates

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