I am working on android quiz game. QuestionActivity and EndgameActivity are 2 classes in my game. I want when my game over control transferred to EndgameActivity. For this i
The problem is not that your EndgameActivity
cannot be found. The exception:
ActivityNotFoundException: No Activity found to handle Intent { act=EndgameActivity }
tells you that EndgameActivity
is somehow being treated as an action. This is odd because you are neither using the constructor Intent(String):
Intent i = new Intent("EndgameActivity");
Nor using Intent#setAction(String).
Try using the fully-qualified class name:
Intent i = new Intent(com.abc.cyk.QuestionActivity.this,
com.abc.cyk.EndgameActivity.class);
Another thing you can try:
Intent i = new Intent();
i.setClass(QuestionActivity.this, com.abc.cyk.EndgameActivity.class);
startActivity(i);
finish();
Although its unrelated to your current issue, I noticed that in EndgameActivity#onCreate(Bundle), you're using:
setContentView(findViewById(R.layout.endgame));
This should be changed to:
setContentView(R.layout.endgame);