Guest User

Untitled

a guest
Jun 22nd, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. Passing listView row positions through Intents to another class
  2. final ListView listView = getListView();
  3. listView.setItemsCanFocus(false);
  4. listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  5. listView.setOnItemClickListener(
  6. new android.widget.AdapterView.OnItemClickListener(){
  7. @Override
  8. public final void onItemClick(AdapterView<?> listView, View cell, int position, long id) {
  9.  
  10.  
  11.  
  12. Intent Courses = new Intent(this, ExpandableList.class);
  13. Courses.putExtra(//I'm not sure what to put in here//)
  14. });
  15.  
  16.  
  17.  
  18. private static final String[] GENRES = new String[] {"Barre","Buffumville","Hodges","Newton Hill"};
  19.  
  20. }
  21.  
  22. Courses.putExtra("position",position);
  23.  
  24. getIntent.getExtras().getInt("position");
  25.  
  26. Intent Courses = new Intent(this, ExpandableList.class);
  27. Courses.putExtra("position",position)
  28. startActivity(Courses);
  29.  
  30. getIntent.getExtras().getInt("position");
Advertisement
Add Comment
Please, Sign In to add comment