0

Is it possible to pass a value in a putExtra or Bundle to be accessed later?

For example, in a standard putExtra you load up the intent with the values you want to pass over and then in the activity specified in the intent, you retrieve those values. Is it possible to store the values in the putExtra and retrieve them in another activity that is NOT the one specified in the intent?

For context, I am using google sign in for authentication. I want to store the user's account in a putExtra and use it later in the app, but not in the activity that follows from the sign on.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Kizzle
  • 101
  • 3
  • 17

1 Answers1

0
  • Use Application or MultiDexApplication class to keep a SharedPreference that holds your data in String format
  • Use SharedPreference at you Activity and follow similar procedure.
  • This link might give you some mental picture.
Ait Bri
  • 498
  • 6
  • 15