close

1.給他自己做一個事件

Button toast = (Button)findViewById(R.id.toast);
        toast.setOnClickListener(new Button.OnClickListener(){
            @Override
            public void onClick(View v) {
                Toast.makeText(v.getContext(),"你是白吃嗎?",Toast.LENGTH_SHORT).show();
            }
        });

2.由自己新增一個事件

public void toast(View v){

    Toast.makeText(v.getContext(),"你是白吃嗎?",Toast.LENGTH_SHORT).show();

}

arrow
arrow
    全站熱搜

    淺翔 發表在 痞客邦 留言(0) 人氣()