SHARE
TWEET

Untitled

a guest Jun 19th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top