After I decided to create an activity to show the results of the game with try again button. Every 3rd try the game will stop with this error.
java.lang.OutOfMemoryError: Failed to allocate a 3819212 byte allocation with 610080 free bytes and 595KB until OOM
What am I doing wrong here?
My try again button code.
public void tryAgain(View view) {
startActivity(new Intent(getApplicationContext(), StartActivity.class));
}
How I call my result activity
Intent intent = new Intent(Constants.CURRENT_CONTEXT.getApplicationContext(), ResultActivity.class);
intent.putExtra("SCORE", obstacleManager.getScore());
Constants.CURRENT_CONTEXT.startActivity(intent);