Skip to content

Instantly share code, notes, and snippets.

@Aiur3908
Created November 24, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aiur3908/18f0b3192e6f3ef5e41e to your computer and use it in GitHub Desktop.
Save Aiur3908/18f0b3192e6f3ef5e41e to your computer and use it in GitHub Desktop.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//取得此Button的實體
button = (Button)findViewById(R.id.button);
//實做OnClickListener界面
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startNextPage();
}
});
}
/**
* 開啟Main2Activity之用
*
*/
private void startNextPage(){
Intent intent = new Intent();
intent.setClass(this , Main2Activity.class);
startActivity(intent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment