良い説明があり、これは同じことをしようとしている人にとって役立つかもしれません!!!
public class ExpList extends ExpandableListActivity
{
String gametype;
// strings for group elements
static final String arrGroupelements[] =
{
"POKER TOURNAMENTS",
"SLOTS TOURNAMENTS",
"ROULLETTE/CRAPS TOURNAMENTS",
"BLACKJACK TOURNAMENTS",
"BINGO/CHARITY BINGO"
};
// strings for child elements
static final String arrChildelements[][] =
{
{
"TEXAS HOLD'EM",
"OMAHA HIGH-LOW",
"SEVEN CARD STUD",
"THREE CARD POKER",
"OTHER POKER VARIANTS",
"ONLINE/SATTELITE TOURNAMENTS"
},
{
"SLOTS"
},
{
"ROULLETTE",
"CRAPS"
},
{
"BLACKJACK"
},
{
"BINGO"
}
};
そして、次のようにonChildClick関数を操作して、その子が下でクリックされたときに文字列の値を「TEXASHOLD'EM」に設定します。
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
//ExpandableListAdapter adapter = getExpandableListAdapter();
gametype = ExpList.arrChildelements[groupPosition][childPosition];
//---------------------
Intent pullt = new Intent(ExpList.this,
SearchActivity.class);
Bundle bundle = new Bundle();
bundle.putString("gametype", gametype);
pullt.putExtras(bundle);
pullt.putExtra("gametype", gametype);
startActivity(pullt);
//---------------------
return false;
}