-1
我的操作欄欄上有一個下拉菜單,當選擇菜單中的任何內容時,該應用程序將打開列表中所選內容下的所有活動。例如,如果在菜單中我有羣組,聊天,朋友,設置選項,如果我選擇聊天,它將打開聊天活動以及朋友和設置。下拉菜單 - 選擇所有案例
我怎樣才能讓這個應用程序將只打開選擇那些活動
MainActivity:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
// Configure the search info and add any event listeners
MenuItem searchItem = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) MenuItemCompat
.getActionView(searchItem);
return true;
}
// Actionbar items
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle presses on the action bar items
switch (item.getItemId()) {
case R.id.action_search:
// searchView.OnQueryTextListener();
case R.id.action_chat: {
// Starting the tabbed browsing for friends, indie/group chats
Intent i = new Intent(MainActivity.this,
GroupIndFriendActivity.class);
startActivity(i);
}
case R.id.action_alarms: {
Intent alerts = new Intent(MainActivity.this,
MyAlerts.class);
startActivity(alerts);
}
case R.id.action_favorite:
// openSettings();
case R.id.action_favorite_specials:
// openSettings();
case R.id.action_settings: {
Intent settings = new Intent(MainActivity.this,
ApplicationSettings.class);
startActivity(settings);
}
default:
return super.onOptionsItemSelected(item);
}
}