Attempt to invoke virtual method ‘void android.widget.TextView.setText(java.lang.CharSequence)’ on a null object reference – Bundle putExtra [duplicate]

You haven’t declared any TextView with id title in you layout. So you are unable to find that textview and hence title object is null.

Add TextView to your layout like this:

<TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" "/>

Leave a Comment