I want to set a list of choice after selected the language choice in menu list.
The list works in the normal button case (onClick) but menu.
Anything I should notice?
sorry for my english
switch (item.getItemId()) {
case R.id.changeCity:
showInputDialog();
return true;
case R.id.Language:
List<String> language = new ArrayList<String>();
language.add(getString(R.string.english));
language.add(getString(R.string.chinese));
new AlertDialog.Builder(WeatherClass.this)
.setSingleChoiceItems(language.toArray(new String[language.size()]), 0,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
})
.show();
return true;
default:
return super.onOptionsItemSelected(item);
}
what I want
Show the list like