// Retrieve a parcelable extra from an Intent Intent intent = new Intent(this, typeof(SecondActivity)); StartActivity(intent); string data = GetStringExtra("data"); if (data != null) { MyParcelable obj = GetParcelableExtra(data) as MyParcelable; if (obj != null) { // Use received object } }
// Retrieve an array of parcelable extras from an Intent Intent intent = new Intent(this, typeof(ThirdActivity)); StartActivity(intent); string[] dataList = GetStringArrayExtra("dataList"); if (dataList != null) { ListIn this example, the GetParcelableExtra method is used inside a loop to retrieve multiple MyParcelable objects from the Intent. Package library: This method is a part of the Android.Content library.objList = new List (); foreach (var data in dataList) { MyParcelable obj = GetParcelableExtra(data) as MyParcelable; if (obj != null) { objList.Add(obj); } } // Use received object list }