Created
November 24, 2015 14:24
-
-
Save Aiur3908/18f0b3192e6f3ef5e41e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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