package com.dome.pokiiez;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class Mainrule extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.mainrule);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_rule, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        super.onOptionsItemSelected(item);

        switch(item.getItemId()){
            case R.id.phone:
                Toast.makeText(getBaseContext(), "กติกา", Toast.LENGTH_SHORT).show();
                Intent i11 = new Intent(this, ru1.class);
                startActivity(i11);
                break;

            case R.id.computer:
                Toast.makeText(getBaseContext(), "การทำฟาล์ว", Toast.LENGTH_SHORT).show();
                Intent i1 = new Intent(this, ru2.class);
                startActivity(i1);
                break;

            case R.id.gamepad:
                Toast.makeText(getBaseContext(), "ข้อบังคับ", Toast.LENGTH_SHORT).show();
                Intent i = new Intent(this, ru3.class);
                startActivity(i);
                break;


        }
        return true;
    }
}