android在自定义的BaseAdapter,给Button添加监听,启动一个新activity报错
我是新手,刚刚学习android开发,请教各位大虾~~android在自定义的BaseAdapter重写getView()函数,给Button添加监听,listItemV...
我是新手,刚刚学习android开发,请教各位大虾~~
android在自定义的BaseAdapter重写getView()函数,给Button添加监听,
listItemView.modify.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Activity.this,Activity2.class);
startAcivity(intent);}
});
Intent这行显示错误:The constructor Intent(Activity1.this, Class<Acivitity2>) is undefined
startAcivity(intent)这行显示错误:The method startAcivity(Intent) is undefined for the type new View.OnClickListener(){}
AndroidManifest.xml文件中已经注册这两个Activity 展开
android在自定义的BaseAdapter重写getView()函数,给Button添加监听,
listItemView.modify.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Activity.this,Activity2.class);
startAcivity(intent);}
});
Intent这行显示错误:The constructor Intent(Activity1.this, Class<Acivitity2>) is undefined
startAcivity(intent)这行显示错误:The method startAcivity(Intent) is undefined for the type new View.OnClickListener(){}
AndroidManifest.xml文件中已经注册这两个Activity 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询