当前位置: > the import android.os.Handler conflicts with a type defined in the same file package...
题目
the import android.os.Handler conflicts with a type defined in the same file package
package test.com;import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;//这里不行
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class Handler extends Activity { /** Called when the activity is first created.*/
private Button startButton = null;
private Button endButton = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
startButton = (Button)findViewById(R.id.startButton);
endButton = (Button)findViewById(R.id.endButton);
startButton.setOnClickListener(new StartButtonListener());
endButton.setOnClickListener(new EndButtonListener());
}
class StartButtonListener implements OnClickListener{
@Override public void onClick(View v) {
// TODO Auto-generated method

提问时间:2021-12-26

答案
...你定义一个和android Handler同名的类干嘛?
你定义的类换个名字就OK
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.