Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- listView.setAdapter(new LTCAdapter(this, list));
- listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- if (position == 1) {
- Intent intent = new Intent(MainActivity.this, Activity1.class);
- startActivity(intent);
- }
- if (position == 2) {
- Intent intent = new Intent(MainActivity.this, Activity2.class);
- startActivity(intent);
- } else {
- Intent intent = new Intent(MainActivity.this, Detail.class);
- startActivity(intent);
- }
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement