标签:
private long firstTime = 0;
public void onBackPressed() {
// super.onBackPressed();
if (System.currentTimeMillis()-firstTime>=2000) {
Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
firstTime=System.currentTimeMillis();
}else {
finish();
}
}
标签:
原文地址:http://www.cnblogs.com/yunqingabc/p/4298864.html