private Integer flag4 = 0 , flag5 = 0 , flag6 = 0 , flag7 = 0, flag8 = 0, flag9 = 0 , flag10 = 0, flag11 = 0, flag12 = 0;
private Integer counter1 = 0 , counter2 = 0;
EditText tex = (EditText) findViewById(R.id.editText3);
@Override
protected void onCreate(Bundle savedInstanceState) {
// setContentView(R.layout.activity_startwith2player);
System.out.println("yes yes");
// StartByPlayerOne();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_startwith2player);
// StartByPlayerOne();
// prrrint();
// Bundle extras = getIntent().getExtras();
// Integer latLong = extras.getInt("NameOfPlayer1");
// TextView player = (TextView)findViewById(R.id.textView3);
// player.setText("" + latLong);
// System.out.println(latLong);
}
Я хочу использовать tex.SetText (String), но до того, что я получил NullPointerException от третьей линии :( Любая идея андроид?!?! OnClick = "Button12" />Почему я получаю NullPointerException от EditText android?
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="score1"
android:id="@+id/textView3"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText3"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/button4"
android:layout_toEndOf="@+id/button4"
android:text="AA" />
Thats мой XML-код
Не могли бы вы поделиться файл макета? – TechnoBlahble
ДА, я разделяю это –