Vote count: 0 as subject says I'm looking for a way to run first if on first click on the button and run next if on click on the button Here is what i tried final Button button = (Button) findViewById(R.id.welcomeButton); final TextView textView = (TextView) findViewById(R.id.welcomeText); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View p1) { int x = 1; if (x == 1) { textView.setText(R.string.step1); button.setText("Next"); // heres increment of the variable x so on next click x will be 2 and the next if will be run instead x++; } if (x == 2) { textView.setText(R.string.step2); button.setText("Next"); } } }); } as you can see theres a increment on first i...
ادامه مطلب