【发布时间】:2015-07-17 21:44:34
【问题描述】:
所以我试图将子项的名称作为字符串获取,以便可以将其添加到我收集的其他数据中并将其插入到数据库中,但是这种方法不起作用,我得到的只是名称父母的。
exp_list.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
TextView the = (TextView) findViewById(R.id.child_txt);
String tx = the.getText().toString();
Toast.makeText(getBaseContext(), tx + " Child Clicked", Toast.LENGTH_SHORT).show();
// Store value in sharedPreferences();
Intent l = new Intent(CategoryActivity.this, AddRecipeActivity.class);
startActivity(l);
return false;
}
});
【问题讨论】:
标签: android textview expandablelistview