コード例 #1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   if (PrefUtils.isUserLogged(prefs)) {
     BarazkideCache.init(prefs);
     UserCache.init(prefs);
     finish();
     GardensActivity_.intent(this).start();
   }
 }
コード例 #2
0
 @UiThread
 void validateUserResult(User user) {
   if (UserUtils.isEmptyUser(user)) {
     prefs.user().put("");
     prefs.pass().put("");
     Toast.makeText(this, "Incorrect user or password.", Toast.LENGTH_SHORT).show();
   } else {
     loginUser(user);
     BarazkideCache.init(prefs);
     UserCache.init(prefs);
     finish();
     GardensActivity_.intent(this).start();
   }
   dialog.cancel();
 }
コード例 #3
0
 @UiThread
 void createAccountResult(int result) {
   switch (result) {
     case USER_EXISTS:
       Toast.makeText(this, "User already exists!", Toast.LENGTH_LONG).show();
       dialog.cancel();
       break;
     case REGISTER_OK:
       Toast.makeText(this, "User registered", Toast.LENGTH_LONG).show();
       dialog.cancel();
       finish();
       GardensActivity_.intent(this).start();
       break;
     case REGISTER_ERROR:
       Toast.makeText(this, "Error creating user!", Toast.LENGTH_LONG).show();
       dialog.cancel();
       break;
   }
 }