我是 android 新手,现在才刚刚开始。对于我来说,当我尝试为应用程序关闭的按钮实现单击侦听器时。任何人都可以帮助我。
以下是代码:
public class Sampleprojectsubbu1Activity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button b1=(Button)findViewById(android.R.id.button1);
b1.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
}
});
}
}