Back to project page 29onlinemultiplayer.
The source code is released under:
MIT License
If you think the Android project 29onlinemultiplayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.shaheed.online29; //w w w. ja v a 2 s . co m import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Environment; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; public class StartActivity extends Activity { private Activity selfActivity; private Button buttonRegister,buttonLogin,buttonQuit; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_start); selfActivity = this; findViewsById(); implementButtons(); } private void findViewsById() { buttonRegister = (Button) findViewById(R.id.registerButton); buttonLogin = (Button) findViewById(R.id.loginButton); buttonQuit = (Button) findViewById(R.id.quitButton); } private void implementButtons() { buttonQuit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Constants.quitButton(selfActivity); } }); buttonRegister.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent in = new Intent(selfActivity, RegistrationActivity.class); in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(in); finish(); } }); buttonLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent in = new Intent(selfActivity, LoginActivity.class); in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(in); finish(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.start, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }