Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. public class tes1 extends AppCompatActivity {
  2. ImageView image;
  3. EditText edit;
  4. int i = 0;
  5. String[] simpanInput = new String[24];
  6. private int[] gambarplate = new int[]
  7. {
  8. R.drawable.ishiharaplate2,
  9. R.drawable.ishiharaplate3,
  10. R.drawable.ishiharaplate4,
  11. R.drawable.ishiharaplate5,
  12. R.drawable.ishiharaplate6,
  13. R.drawable.ishiharaplate7,
  14. R.drawable.ishiharaplate8,
  15. R.drawable.ishiharaplate9,
  16. R.drawable.ishiharaplate10,
  17. R.drawable.ishiharaplate11,
  18. R.drawable.ishiharaplate12,
  19. R.drawable.ishiharaplate13,
  20. R.drawable.ishiharaplate14,
  21. R.drawable.ishiharaplate15,
  22. R.drawable.ishiharaplate16,
  23. R.drawable.ishiharaplate17,
  24. R.drawable.ishiharaplate18,
  25. R.drawable.ishiharaplate19,
  26. R.drawable.ishiharaplate20,
  27. R.drawable.ishiharaplate21,
  28. R.drawable.ishiharaplate22,
  29. R.drawable.ishiharaplate23,
  30. R.drawable.ishiharaplate24
  31. };
  32.  
  33. @Override
  34. protected void onCreate(Bundle savedInstanceState) {
  35. super.onCreate(savedInstanceState);
  36. setContentView(R.layout.activity_tes1);
  37. image = (ImageView) findViewById(R.id.imageview);
  38. edit = (EditText) findViewById(R.id.edittext);
  39. Button submit = (Button) findViewById(R.id.submit);
  40. submit.setOnClickListener(new View.OnClickListener() {
  41. public void onClick(View v) {
  42. btnSubmit();
  43. }
  44. });
  45. }
  46.  
  47. private void btnSubmit() {
  48. i++;
  49. if (i >= 23) {
  50. i = 0;
  51. }
  52. image.setImageResource(gambarplate[i]);
  53. simpanInput = edit.getText().toString();
  54. }
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement