java.lang.RuntimeException: Unable to start activity ComponentInfo{ui.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EditText.setText(java.lang.CharSequence)' 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

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Stack Overflow by Esteban
, 10 months ago
Unable to start activity ComponentInfo{ui.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EditText.setText(java.lang.CharSequence)' on a null object reference
via GitHub by blFeedbackBot
, 1 year ago
Unable to start activity ComponentInfo{us.shandian.blacklight/info.papdt.blacklight.ui.statuses.UserTimeLineActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.os.Bundle.getCharSequence(java.lang.String)' on a null object reference
via GitHub by jogrimst
, 1 year ago
Unable to start activity ComponentInfo{org.literacyapp.calculator/com.android.calculator2.Calculator}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.calculator2.view.MultiButton.setEnabled(int)' on a null object reference
via GitHub by tomglanville
, 6 months ago
Unable to start activity ComponentInfo{com.studygoal.jisc/com.studygoal.jisc.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by CBA110
, 1 year ago
Unable to start activity ComponentInfo{uk.co.my_package.weatherscan/uk.co.my_package.weatherscan.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.LinearLayoutManager.onRestoreInstanceState(android.os.Parcelable)' on a null object reference
via Stack Overflow by Miki P
, 1 year ago
Unable to start activity ComponentInfo{com.android.miki.rpiplantsapp/com.android.miki.rpiplantsapp.PlantStatsActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.miki.rpiplantsapp.MoistureFragment.setOptimalStatText(java.lang.String)' on a null object reference
java.lang.RuntimeException: Unable to start activity ComponentInfo{ui.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EditText.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)

Users with the same issue

Once, 1 year ago
4 times, 1 year ago
Once, 1 year ago
4 times, 10 months ago
42 times, 1 year ago

Write tip

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