Hope this helps:
* in *oneActivity*
**
START THE NEW Activity SOMEWHERE
var intent = new Intent();
intent.SetClass(this, typeof(twoActivity));
StartActivityForResult(intent, 1);
AND
protected override void OnActivityResult(int requestCode, ResultresultCode,
Intent data) {
if (requestCode == 1) {
switch (resultCode) {
case Result.Canceled: break;
case Result.FirstUser:break;
case Result.Ok:
var theNumber = data.GetIntExtra("TheNumber", 1); // default will be 1
Toast.MakeText(this, String.Format("Do something with this number {0}",
theNumber),
ToastLength.Short).Show();
break;
default:break;
}
}
}
* in *twoActivity*
private void _list_ItemClick(object sender, ItemEventArgs e) {
var aNumber =
((YourListAdapter)_list.Adapter).GetNumber(e.Position); // your
code may vary
Intent.PutExtra("TheNumber", aNumber);
SetResult(Result.Ok, Intent);
Finish(); // goes back to the caller (oneActivity)
}
On Fri, Mar 23, 2012 at 11:13 AM, james smoot <[email protected]> wrote:
> I am having a hard time getting a Activity to start in Mondroid using C#
>
> "oneActivity1" is the active Activity
> I want to start twoActivity which extends listActivity
>
> I want to use "Intent" so I can return a number from the list
>
> The problem is I can't find demo code in *C#*
>
>
> Thanks!
>
>
>
>
> _______________________________________________
> Monodroid mailing list
> [email protected]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid