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();
}
全站熱搜