Guest User

Untitled

a guest
Jan 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. public class activity_fruit extends AppCompatActivity {
  2. TextView textView;
  3.  
  4. @Override
  5. protected void onCreate(Bundle savedInstanceState) {
  6. super.onCreate(savedInstanceState);
  7. setTitle("Fruit");
  8. setContentView(R.layout.activity_fruit);
  9.  
  10. textView = (TextView) findViewById(R.id.txtstatus);
  11. textView.setText(((Globals) this.getApplication()).getTaal());
  12.  
  13. int fruit1 = R.drawable.kumato;
  14. ImageView targetImageView1 = findViewById(R.id.img_fruit1);
  15. targetImageView1.setOnClickListener(new DoubleClickListener() {
  16. @Override
  17. public void onSingleClick(View v) {
  18. if(textView.equals("ENG")) {
  19. Toast.makeText(getApplicationContext(), "eng single", Toast.LENGTH_SHORT).show();
  20. }
  21. if (textView.equals("")) {
  22. Toast.makeText(getApplicationContext(), "nl single", Toast.LENGTH_SHORT).show();
  23. }}
  24.  
  25. @Override
  26. public void onDoubleClick(View v) {
  27. Toast.makeText(getApplicationContext(), "double", Toast.LENGTH_SHORT).show();
  28. }
  29. });
  30. Glide.with(this)
  31. .load(fruit1)
  32. .into(targetImageView1);
Add Comment
Please, Sign In to add comment