0 item

UrsAdda Blog

Time to share your experience your thoughts your feeling. Happy blogging

Use of putExtra() and getExtra() for string and retrieving data

​Whenever we want to send string data from one activity to other ,we can use putExtra() and getExtra().Suppose,Your first activity is:String name="xyz";Intent intent = new Intent(SendingActivity.this, RecievingActivity.class); intent.putExtra("keyname", name); // pass your values and retrieve them in the other Activity using keyName ...
Continue reading
102 Hits
0 Comments

Using shared preferences to pass a string value from one activity to other

Suppose if you want to pass a string value from one activity to other below are the steps : Sender Activity : String register_id = "20"; SharedPreferences sharedPref =PreferenceManager.getDefaultSharedPreferences(getActivity()); SharedPreferences.Editor editor = sharedPref.edit(); editor.putString("register_id", register_id); editor....
Continue reading
75 Hits
0 Comments