views:

46

answers:

3

I developed one app in that i want to sen URI from Class1 editText to another class containing editText can anyone tell me how to do that

A: 

Assuming you want to use the SharedPreferences to transfer the URI, you could try this:

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
prefs.edit().putString("my-uri", "http://google.com/").commit();

And to retrieve the URI:

prefs.getString("my-uri", "default URI");

If your two classes are Activities, and if one of them starts the other one, you should probably pass the URI as an intent extra.

Also, read the FAQ and accept some answers!

benvd
+2  A: 

SharedPreferences are the wrong way to do that. Use the Bundle feature every Intent can have: http://developer.android.com/reference/android/content/Intent.html

On the second activity you can call getExtra() and there you go...

WarrenFaith
A: 

you can use System.setProperty/get Property as well.