11
탐색 창 헤더에서 TextView의 텍스트를 변경하는 방법은 무엇입니까?
탐색 창 헤더 내에서 TextView의 텍스트를 변경하고 싶습니다. 하지만이 오류가 발생합니다. java.lang.NullPointerException : null 객체 참조에서 가상 메소드 'void android.widget.TextView.setText (java.lang.CharSequence)'호출 시도 activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:openDrawer="start"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <include layout="@layout/app_bar_main" android:layout_width="match_parent" android:layout_height="wrap_content" /> <FrameLayout android:id="@+id/frame_container" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> …