Skip to content

Instantly share code, notes, and snippets.

@burnix
Created February 7, 2016 12:53
Show Gist options
  • Save burnix/1ea1fbcb40328307b956 to your computer and use it in GitHub Desktop.
Save burnix/1ea1fbcb40328307b956 to your computer and use it in GitHub Desktop.
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