@Override
public void onBackPressed() {
// TODO 退出提示
if (System.currentTimeMillis() - mExitTime > 1000) {
if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
mDrawerLayout.closeDrawer(GravityCompat.START);
}
//点击间隔大于2s
Toast.makeText(this, getResources().getString(R.string.exit_app), Toast.LENGTH_SHORT).show();
mExitTime = System.currentTimeMillis();
} else {
//连续点击2次退出应用
finish();
}
return;
}