Exemplo n.º 1
0
 @Override
 public void onBackPressed() {
   long curTime = System.currentTimeMillis();
   if (curTime - lastTime < 1500) {
     super.onBackPressed();
     FileUtil.saveFile(ContextUtil.getContext(), FileUtil.FILE_COMPANY, Company.getInstance());
   } else {
     ContextUtil.toast("再按一次退出!");
     lastTime = curTime;
   }
 }
Exemplo n.º 2
0
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putSerializable("company", Company.getInstance());
 }
Exemplo n.º 3
0
 @Override
 protected void onRestoreInstanceState(Bundle savedInstanceState) {
   super.onRestoreInstanceState(savedInstanceState);
   Company.loadInstance((Company) savedInstanceState.getSerializable("company"));
   sendBroadcast(new Intent(LoginManager.ACTION_INVALIDATE));
 }