我声明了一个意图,该意图将转到下一个活动。但是我收到一条错误消息,指出构造函数意图未定义。感谢任何可以告诉如何解决此问题的人。
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)
。