我想知道默认情况下是否有办法打开导航菜单?
我的应用程序基于此菜单,因此如果默认情况下导航菜单未打开,则看起来我的应用程序是空的。
我的偏好是XML。
感谢您的帮助!
答案 0 :(得分:3)
// Delay is in milliseconds
static final int DRAWER_DELAY = 200;
@Override
protected void onCreate(Bundle savedInstanceState) {
...
// Building NavDrawer logic here. Just a method call would be best.
...
new Handler().postDelayed(openDrawerRunnable(), DRAWER_DELAY);
}
private Runnable openDrawerRunnable() {
return new Runnable() {
@Override
public void run() {
drawerLayout.openDrawer(Gravity.LEFT);
}
}
}