我有活动,我们称之为TestActivity。此TestActivity扩展了具有导航抽屉的活动。在TestActivity中,我想更改NavigationDrawerToggle并将其替换为向上箭头。扩展导航抽屉活动
public class Test extends DashboardActivity {
private DrawerLayout navDrawerLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
navDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.test, menu);
return true;
}
@Override
public void onBackPressed() {
this.finish();
super.onBackPressed();
}
}
仪表盘活动是有点长,我有一些更多的东西有,但basicaly它遵循本教程:http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/
谢谢,这就是我一直在寻找的东西。 –