示例#1
0
 protected void checkLogin() {
   User user = this.getScannerApplication().getUser();
   if (user == null || user.getToken() == null) {
     Intent intent = new Intent(this, LoginActivity.class);
     startActivity(intent);
   }
 }
示例#2
0
 private void doLogout() {
   User user = this.getScannerApplication().getUser();
   if (user != null) {
     user.update(
         user.getEmail(),
         null,
         user.getRole(),
         user.get_id(),
         user.getDatabases(),
         user.getDefaultDatabase());
     Intent intent = new Intent(this, LoginActivity.class);
     startActivity(intent);
   }
 }