@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
currentTime = System.currentTimeMillis();
}

@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
if(currentTime!=0 && System.currentTimeMillis() - this.currentTime > PERIOD){
new AlertDialog.Builder(this)
.setTitle("提示")
.setMessage("您已10天未在线登录,为了您的账号安全请重新登录")
.setPositiveButton("确定",new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface paramDialogInterface,
int paramInt) {
// TODO Auto-generated method stub
//GlobalModel.getInstance().getDownloadTask().removeAllTast();
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(intent);
MainActivity.this.finish();

}
}).show();
}
}

更多相关文章

  1. Android(安卓)代码片段---从相册或相机获取图片保存并处理
  2. Android(安卓)按钮 弹出对话框
  3. Android(安卓)- 对话框(Dialog)和通知(Notification)2
  4. android mapview
  5. android 弹出带按钮的对话框
  6. android mapview
  7. android登录简单窗口
  8. 基于Android的短信管理系统
  9. android Multiple markers at this line - The type java.lang.C

随机推荐

  1. Android系统中自带的图标&一些预定义样式
  2. android中使用wakelock
  3. 一个很有深度的Android(安卓)Blog
  4. Android(安卓)自定义格式的对话框
  5. Android(安卓)新手入门指导
  6. Android:UI设置-横竖屏转换、输入法键盘相
  7. Android的Thread & ProgressBar
  8. Android:Debug certificate expired on D
  9. android预定义样式
  10. android 塔防游戏汇总 及android 游戏开