Android 开发笔记(一) 按钮事件调用Activity

UI创建按钮及事件

Button mEmailSignInButton = (Button) findViewById(R.id.email_sign_in_button);
mEmailSignInButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
      //Do Sth
}
});

调用Activity

Intent intent = new Intent();
intent.setClass(LoginActivity.this,MainActivity.class);
startActivity(intent);
LoginActivity.this.finish();
 
posted on 2016-01-17 15:17  SuperSky  阅读(689)  评论(0编辑  收藏  举报