I have three activities.
- Settings activity [A] // where you input a number that will be used in the main activity
- Main activity [B] // where it uses the number inputted by the settings activity
- Pause activity [C] // which is dialog that pauses the main activity and gives you the option to reset it
My problem is that i cant find a way to pass that number from A to B and that number to be saved for when the user resets B from C.I have tried some methods but i cant make it work. My code:
A:
long npsum = npint * 60000 + np3int * 1000;
Intent cardintent = new Intent(getApplicationContext(), card_game_2.class);
cardintent.putExtra("card2string",npsum);
startActivity(cardintent);
B:
Bundle card2extras = getIntent().getExtras();
if (card2extras != null) {
String startcardstring = card2extras.getString("card2string");
startcard = Long.parseLong(startcardstring);
}
C:
Intent resetintent = new Intent(card_2_pause.this, card_game_2.class);
startActivity(resetintent);
Thanks for any help