问题描述:在安卓模拟上运行程序,程序闪退,显示:xx has stopped
提示:Caused by: java.lang.ClassCastException: com.example.cheung.sbulter.MainActivity cannot be cast to android.view.View.OnClickListener
解决办法:In MainActivity, you should implement View.OnClickListener. in this case, you don't need your own interface XXXXXXX.java, just use View.OnClickListener
that is to say, change
public class MainActivity extends Activity implements onClickListener
to
public class MainActivity extends Activity implements View.OnClickListener
结果:已解决