Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void plus3(View v) {
- switch (v.getId()) {
- case R.id.button:
- TextView score = (TextView) findViewById(R.id.textView3);
- String s = score.toString();
- int x = Integer.parseInt(s);
- x += 3;
- score.setText("" + x);
- break;
- case R.id.button2:
- TextView scoreB = (TextView) findViewById(R.id.textView4);
- String sB = scoreB.toString();
- int xB = Integer.parseInt(sB);
- xB += 3;
- scoreB.setText("" + xB);
- break;
- }
- }
- }
- //Вызов в вью кнопки:
- android:onClick="plus3"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement