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
Check your manifest file you register activity
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=EndgameActivity }
i am going through your code, remove findViewById
from your code
setContentView(findViewById(R.layout.endgame));
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);
Addyour EndGame Activity in the manifest file. Logcat clearly says
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=EndgameActivity }
Just add the EndgameActivity in the manifest file inside a new activity tag.