[mono-android] Passing state from Java activity to monodroid

Jonathan Pryor jonp at xamarin.com
Wed Jan 4 11:43:21 EST 2012


On Jan 4, 2012, at 2:07 AM, consultutah wrote:
> What's the easiest way to pass a string from a Java Activity that doesn't return to C#?

Add the string as an Intent "extra", via Intent.PutExtra(string, string):

	http://androidapi.xamarin.com/?link=M%3aAndroid.Content.Intent.PutExtra(System.String%2cSystem.String)

> I am using a java activity in my MonoDroid app:
> 
> var spec = tabHost.NewTabSpec("Spec");
> Intent intent = new Intent(this, Java.Lang.Class.ForName("com.whatever.CoolActivity"));

	intent.PutExtra ("key", "value");

 - Jon



More information about the Monodroid mailing list