2014-12-03 109 views
1

我創建了一個新的android項目,目標是android棒棒糖。 我正在測試運行棒棒糖LG G3的設備上的應用程序。如果我從活動菜單中刪除標題欄,則不會顯示選項。事實上,在以下版本中,用於在屏幕右下方可見的菜單。菜單不顯示在android棒棒糖?

這是我的代碼。

public class MainActivity extends ActionBarActivity { 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    this.getWindow().setSoftInputMode(
      WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); 
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
      WindowManager.LayoutParams.FLAG_FULLSCREEN); 
    this.requestWindowFeature(Window.FEATURE_NO_TITLE); 
    setContentView(R.layout.activity_main); 
} 

@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); 
    return true; 
} 

@Override 
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(); 
    if (id == R.id.action_settings) { 
     return true; 
    } 
    return super.onOptionsItemSelected(item); 
} 

}

回答

0

只需要長按任務管理器按鈕和菜單選項出現。

+0

這對我不起作用 – 2015-03-17 17:52:53

+0

您面臨的問題是什麼? – WISHY 2015-03-18 05:19:01