I already asked a similar question, but now the situation is a bit different: you need to throw an activity in the collision with a message that you lost. Did:
Context context = getContext(); Intent intent = new Intent(context, FiledActivity.class); context.startActivity(intent); But it is no reaction. Maybe there is some other way, because I understand that this option is for a click?
UPD: Fully all function:
private void testCollision() { /*Движение с лево на право по Х*/ Iterator<SpriteListX> i = rx.iterator(); while(i.hasNext()) { SpriteListX sp = i.next(); if ((Math.abs(sp.x - px) <= (sp.width + p.width) / 2f) && (Math.abs(sp.y - py) <= (sp.height + p.height) / 2f)) { i.remove(); this.running = false; Context context = getContext(); Intent intent = new Intent(context, FiledActivity.class); //а не new Intent(this, MyActivity.class) context.startActivity(intent); } } }