我创建了一个带有导航抽屉的应用程序。我想改变操作栏的颜色和抽屉的默认图标在选择一个特定的导航菜单项时更改,它应该在选择任何其他项时更改为默认值。
我的代码
Fragment fragment;
if(fragment.toString().contains("HomeFragment")){
ab = ((BaseActivity)getApplicationContext()).getSupportActionBar();
ab.setHomeButtonEnabled(true);
ab.setDisp
我以前使用过Android的向导来实现主细节模式,并且尝试将细节转换为有一个抽屉而不是"up“按钮。
我在AndroidManifest.xml中删除了细节活动设置中的“父”属性,但它仍然没有工作。
然后,我意识到在我的详细活动的onOptionsItemSelected函数中,我忘记删除以下内容:
if (id == android.R.id.home) {
// This ID represents the Home or Up button. In the case of this
// activity, the Up butto