java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.musicplayer/com.example.android.musicplayer.ArtistLibrary}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setOnClickListener(android.view.View$OnClickListener)' 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 Tarik Hodzic
, 1 year ago
Unable to start activity ComponentInfo{com.example.android.musicplayer/com.example.android.musicplayer.ArtistLibrary}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by GiBong Lim
, 10 months ago
Unable to start activity ComponentInfo{com.example.gibong.capstone/com.example.gibong.capstone.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by Amit Kishor
, 1 year ago
Unable to start activity ComponentInfo{com.example.atry.atry/com.example.atry.atry.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by Maruf Heavyman
, 1 year ago
Unable to start activity ComponentInfo{com.deneme.deneme/com.deneme.deneme.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by adem mehdioui
, 2 months ago
Unable to start activity ComponentInfo{info.adem.tplogin/info.adem.tplogin.FriendActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
via Stack Overflow by Shibin Kalliatt
, 4 months ago
Unable to start activity ComponentInfo{net.donateclub.codend.donateclub/net.donateclub.codend.donateclub.ResetPasswordOTP}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
at com.example.android.musicplayer.ArtistLibrary.onCreate(ArtistLibrary.java:18)
at android.app.Activity.performCreate(Activity.java:6876)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)

Users with the same issue

You are the first who have seen this exception.

Write tip

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