我有一個活動2片段和抽屜。所以當我在片段中時,我得到了「Up」圖標,而不是漢堡包圖標(在setDisplayHomeAsUpEnabled的幫助下),但動作仍然相同 - navigation_drawer_open/close。那麼如何讓onBackPressed()代替呢?如何使用setDisplayHomeAsUpEnabled和片段
而根據這個評論,我不知道如何處理家/自己因爲「自動處理點擊」。
@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.
你有沒有想過這個? – Plasma