示例#1
0
 public void login(View view) {
   final User user = (User) getApplication();
   user.login();
   Intent intent = new Intent(this, Main.class);
   startActivity(intent);
   finish();
 }
示例#2
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   final User user = (User) getApplication();
   super.onCreate(savedInstanceState);
   if (user.isLogin()) {
     Intent intent = new Intent(this, Main.class);
     startActivity(intent);
     finish();
   }
   setContentView(R.layout.activity_login);
 }