我想自定义功能区菜单(https://github.com/jaredsburrows/RibbonMenu),当我点击菜单项时,原始菜单仅显示一个 ListView。我想在按键后打开新的意图,而不仅仅是列表视图。我尝试了类似的方法,但这会打开一个没有功能区菜单的新意图。我的目的是在这个菜单中打开新的意图或活动——就像一个列表视图。你能帮我吗?
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
switch (position)
{
case 0:
Intent i = new Intent(MainActivity.this, About.class);
MainActivity.this.startActivity(i);
//final String[] items = { "A", "B", "C", "D" };
//adapter = new ArrayAdapter<String>(MainActivity.this, android.R.layout.simple_list_item_1, items);
// list.setAdapter(adapter);
break;
case 1:
final String[] items1 = { "1", "2", "3", "4" };
adapter = new ArrayAdapter<String>(MainActivity.this, android.R.layout.simple_list_item_1, items1);
list.setAdapter(adapter);
break;
}
rbmView.hideMenu();
}