bae*_*n83 6 android toolbar android-toolbar
我有一个适用于Android sdk版本23的Android应用程序.现在我尝试使用版本19到23的用户可用.所有工作正常,期望应用程序头部的工具栏.我无法点击菜单项.点击时没有任何动静.此外,如果我插入Log.v(),调试视图中没有消息.
我能做什么?
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
if (id == R.id.action_refresh) {
doRefreshGames(item);
return true;
}
if(id == R.id.action_rss){
Intent rssIntent = new Intent(AmericanFootball.this, AmericanFootballRSS.class);
//if you need to pass data:
Bundle mBundle = new Bundle();
mBundle.putString("myKey", "comeon");
rssIntent.putExtras(mBundle);
startActivity(rssIntent);
}
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
return super.onOptionsItemSelected(item);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
457 次 |
| 最近记录: |