0

in android how we save one value to acces on each page,

for example I am making a login app

and I need user_id to each page for access data from db by this id

or

I am in home page and I want to store user_id ,and I need to access this on any page ,

for example home=>profile=> change password,

I want to access user_id here to change password

I am trying

Intent slideactivity = new Intent(login.this, LoginMenu.class);
    slideactivity.putExtra("uName", n);

but When I access it it give empty value on create_password activity

apomene
  • 14,282
  • 9
  • 46
  • 72

2 Answers2

1

You can use Shared Preferences. Please have a read.

http://developer.android.com/guide/topics/data/data-storage.html#pref

Hope this helps.

jagmohan
  • 2,052
  • 2
  • 26
  • 41
0

Also... a previous stackoverflow answer may help you out in this scenario. Have a look here...

How do I pass data between Activities in Android application?

Hope this also helps.

Community
  • 1
  • 1
P_Fitz
  • 819
  • 9
  • 16