我已經提到了這個博客教程。但是,我想不通,他們在這個編碼中從哪里得到“R.menu.main”?@Overridepublic boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true;}和..他們從哪里得到“R.id.action_settings”?@Overridepublic boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item);}我試圖通過根據此博客教程添加一點來更改我的編碼。我的應用程序仍然崩潰,它突然關閉。
添加回答
舉報
0/150
提交
取消