Android:the application has stopped unexpectedly
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/08/23 08:14:31
Android:the application has stopped unexpectedly
package com.misoo.ex02;
import android.app.Activity;
import android.view.View.OnClickListener;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Ex02Activity extends Activity implements OnClickListener{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btn = (Button)findViewById(R.id.button);
Button btn2 = (Button)findViewById(R.id.button2);
btn.setOnClickListener(this);
btn2.setOnClickListener(this);
}
public void onClick(View v)
{
\x05switch(v.getId())
\x05{
\x05case R.id.button:
\x05\x05setTitle("this is OK button..");
\x05\x05break;
\x05case R.id.button2:
\x05\x05this.finish();
\x05\x05break;
\x05}
}
}
-----------------------------------------
main.xml
xml version="1.0" encoding="utf-8"?>
哪里出错了啊?
package com.misoo.ex02;
import android.app.Activity;
import android.view.View.OnClickListener;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class Ex02Activity extends Activity implements OnClickListener{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btn = (Button)findViewById(R.id.button);
Button btn2 = (Button)findViewById(R.id.button2);
btn.setOnClickListener(this);
btn2.setOnClickListener(this);
}
public void onClick(View v)
{
\x05switch(v.getId())
\x05{
\x05case R.id.button:
\x05\x05setTitle("this is OK button..");
\x05\x05break;
\x05case R.id.button2:
\x05\x05this.finish();
\x05\x05break;
\x05}
}
}
-----------------------------------------
main.xml
xml version="1.0" encoding="utf-8"?>
哪里出错了啊?
把logcat 里面的错误信息 贴出来 .
Android出错The application has stopped unexpectedly
Android:the application has stopped unexpectedly
android启动时出现The application has stopped unexpectedly.
Android程序运行the application has stopped unexpectedly. please
Android为什么每次运行时都出现这种The application has stoped unexpectedly.
android开发出现The application has stoped unexpectedly.Logcat内容见
学习android,run as 之后出现The application *** has stopped unexpec
he has died.the rain has stopped.
The clock has stopped ;The clock Was stopped
android application project下怎么没有 android application project
The rain has stopped,but the heart still drop
the bus__on the road for an hour.a.has stopped b.stopped c.i