Error after pressing a button
This question already has an answer here:
试试这个代码
Button button1 = (Button) findViewById(R.id.button1);
button1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v)
{
Toast.makeText(getApplicationContext(), "Button pressed.",Toast.LENGTH_LONG).show();
}
});
链接地址: http://www.djcxy.com/p/96820.html
下一篇: 按下按钮后出错