Created
February 7, 2016 12:53
-
-
Save burnix/1ea1fbcb40328307b956 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
import android.content.Intent; | |
import android.graphics.Typeface; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.widget.Button; | |
/** | |
* Created by igor on 07.02.16. | |
*/ | |
public class Menu extends AppCompatActivity implements View.OnClickListener{ | |
protected Button bt1, bt2, bt3; | |
protected Typeface tf; | |
protected Intent intent; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.layout); | |
bt1 = (Button) findViewById(R.id.bt1); | |
bt2 = (Button) findViewById(R.id.bt2); | |
bt3 = (Button) findViewById(R.id.bt3); | |
bt1.setOnClickListener(this); | |
bt2.setOnClickListener(this); | |
bt3.setOnClickListener(this); | |
tf = Typeface.createFromAsset(getAssets(), "Arial.ttf"); | |
bt1.setTypeface(tf); | |
bt2.setTypeface(tf); | |
bt3.setTypeface(tf); | |
} | |
@Override | |
public void onClick(View v){ | |
switch (v.getId()) { | |
case R.id.bt1: | |
intent = new Intent(Menu.this, instruction.class); | |
startActivity(intent); | |
break; | |
case R.id.bt2: | |
intent = new Intent(Menu.this, statistics.class); | |
startActivity(intent); | |
break; | |
case R.id.bt3: | |
intent = new Intent(Menu.this, play.class); | |
startActivity(intent); | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment