java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.john.myfirstapp/com.john.myfirstapp.DisplayMessageActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' 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

Samebug tips

,

Create an empty public constructor in your code.

Solutions on the web

via Stack Overflow by John Matthews
, 1 year ago
Unable to instantiate activity ComponentInfo{com.john.myfirstapp/com.john.myfirstapp.DisplayMessageActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
via Stack Overflow by DaxHR
, 2 years ago
Unable to instantiate activity ComponentInfo{com.example.dario.mojaaplikacija/com.example.dario.mojaaplikacija.BenchA}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
via Stack Overflow by Ameer Akashe
, 1 year ago
Unable to instantiate activity ComponentInfo{com.example.ecohapp/com.example.ecohapp.SignUpActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
via Stack Overflow by no_ideaw
, 5 months ago
Unable to instantiate activity ComponentInfo{ir.noideaw.instafeed/ir.noideaw.instafeed.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 코딩중
, 2 months ago
Unable to instantiate activity ComponentInfo{com.example.ggavi.myapplication/com.example.ggavi.myapplication.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 Abhi
, 1 year ago
Unable to start activity ComponentInfo{com.example.abhishek.httpclient/com.example.abhishek.httpclient.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.database.Cursor
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.john.myfirstapp/com.john.myfirstapp.DisplayMessageActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)

Users with the same issue

66 times, 3 weeks ago
Once, 2 months ago
33 times, 3 months ago
8 times, 3 months ago
468 times, 4 months ago

Write tip

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