android-textview settext zeigen, nullpointer exception

<TextView
android:id="@+id/first_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/black"
android:textColor="@color/light_grey"
android:text="FirstName"
></TextView>

TextView first_text_view;

first_text_view = (TextView)this.findViewById(R.id.first_name);
try {
first_text_view.setText("Android");
}catch(Exception e) {
}

bekam ich die nullpointer exception.

was ist die Lösung für dieses. bitte Antworten Sie mir

InformationsquelleAutor saravanan | 2010-03-02
Schreibe einen Kommentar