Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 22nd, 2012  |  syntax: None  |  size: 0.97 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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");