Hi I am new to programming and was having a lot of fun starting until I copied a tutorial for an expandable list and have been stuck for over 1 week.
I'm trying to use the final selection from an expandable list and pass this information to my new activity. The way it is set up now is I can pass the string value id (I don't want this) I want the actual string that was clicked.
public class MainActivity extends Activity {
public final static String ID_EXTRA = "com.example.chris.prontopages2.MainActivity.";
HashMap<String, List<String>> Movies_category;
List<String> Movies_list;
ExpandableListView Exp_list;
MoviesAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Exp_list = (ExpandableListView) findViewById(R.id.exp_list);
Movies_category = DataProvider.getInfo();
Movies_list = new ArrayList<String>(Movies_category.keySet());
adapter = new MoviesAdapter(this, Movies_category, Movies_list);
Exp_list.setAdapter(adapter);
Exp_list.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
Intent i = new Intent("Main22Activity.class");
i.putExtra(ID_EXTRA, String.valueOf(id));
startActivity(i);
return false;
}
});
}