[英]Why do I get “The constructor Intent(Class<LivrmStartActivity>) is undefined” message?
我声明了将要进行下一个活动的意图。 但是我收到一条错误消息,指出构造函数意图未定义。 感谢任何可以告诉您如何解决此问题的人。
if (i < badsprite) {
score++;
badsprite--;
sounds.play(sndSquish, 1.0f, 1.0f, 0 , 0, 1.5f);
} else{
life--;
sounds.play(sndOuch, 1.0f, 1.0f, 0, 0, 1.5f);
}
sprites.remove(sprite);
temps.add(new PorchTempSprite(temps, this, x, y, bmpSlime));
if (badsprite == 0){
Intent m = new Intent(LivrmStartActivity.class); //Where the error is
startActivity(m); //And here too
}
break;
}
}
}
}
return true;
}
}
您会收到该错误,因为没有这样的构造函数。 假设其余代码正确,请改用new Intent(this, LivrmStartActivity.class)
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.