I have a hitcount that I need to be passed to another activity I know how to receive it but I'm not sure how to format it to make sure it gets passed to the other activity. The activity with the receiver is named GameActivity. This is my receiver:
public void finish(){
Intent returnIntent = new Intent();
returnIntent.putExtra("GAME_SCORE",gameView.getHitCount());
setResult(RESULT_OK, returnIntent);
super.finish();
}
I know I have to create a getHitCount field that will pass it to the intent but I'm not sure how to do this. The relevant field is called hitCount, I've also included where it is incremented.
if (sprite.wasItTouched(event.getX(), event.getY())){
/* For now, just renew the Sprite */
sprite = new Sprite(this);
hitCount++;
}
public void getHitCount() {
}