package cn.edu.xjau.activitytest;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class FirstActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.first_layout);
        
        Button button1 = (Button) findViewById(R.id.button_1);
        button1.setOnClickListener(new View.OnClickListener( ){
            @Override
            public void onClick(View v) {
                Toast.makeText(FirstActivity.this , "You click Button 1", 
                        Toast.LENGTH_SHORT).show();
            }
        });
    }
}
