Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class tes1 extends AppCompatActivity {
- ImageView image;
- EditText edit;
- int i = 0;
- String[] simpanInput = new String[24];
- private int[] gambarplate = new int[]
- {
- R.drawable.ishiharaplate2,
- R.drawable.ishiharaplate3,
- R.drawable.ishiharaplate4,
- R.drawable.ishiharaplate5,
- R.drawable.ishiharaplate6,
- R.drawable.ishiharaplate7,
- R.drawable.ishiharaplate8,
- R.drawable.ishiharaplate9,
- R.drawable.ishiharaplate10,
- R.drawable.ishiharaplate11,
- R.drawable.ishiharaplate12,
- R.drawable.ishiharaplate13,
- R.drawable.ishiharaplate14,
- R.drawable.ishiharaplate15,
- R.drawable.ishiharaplate16,
- R.drawable.ishiharaplate17,
- R.drawable.ishiharaplate18,
- R.drawable.ishiharaplate19,
- R.drawable.ishiharaplate20,
- R.drawable.ishiharaplate21,
- R.drawable.ishiharaplate22,
- R.drawable.ishiharaplate23,
- R.drawable.ishiharaplate24
- };
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_tes1);
- image = (ImageView) findViewById(R.id.imageview);
- edit = (EditText) findViewById(R.id.edittext);
- Button submit = (Button) findViewById(R.id.submit);
- submit.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- btnSubmit();
- }
- });
- }
- private void btnSubmit() {
- i++;
- if (i >= 23) {
- i = 0;
- }
- image.setImageResource(gambarplate[i]);
- simpanInput = edit.getText().toString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement