Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. listView.setAdapter(new LTCAdapter(this, list));
  2.  
  3. listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  4. @Override
  5. public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  6.  
  7. if (position == 1) {
  8. Intent intent = new Intent(MainActivity.this, Activity1.class);
  9. startActivity(intent);
  10. }
  11.  
  12. if (position == 2) {
  13. Intent intent = new Intent(MainActivity.this, Activity2.class);
  14. startActivity(intent);
  15.  
  16. } else {
  17. Intent intent = new Intent(MainActivity.this, Detail.class);
  18. startActivity(intent);
  19. }
  20.  
  21.  
  22. }
  23. });
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement