Using XamarinStudio and below code base on the Sample in the tutorial. Here the questions.
- Do I need to generate the AndroidManifest from the Project Option> Android Application when testing the App ?
Why there is no data passing over even I have generated an AndroidManifest , the code :
---Activity 1 [Activity (Label = "HelloMultiScreen", MainLauncher = true,Icon = "@drawable/icon")] public class FirstActivity : Activity { int count = 1; protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); //Use UI created in Main.axml SetContentView (Resource.Layout.Main); var showSecond = FindViewById (Resource.Id.showSecond); showSecond.Click += (sender, e) => { var second = new Intent(this, typeof(SecondActivity)); second.PutExtra("FirstData", "Data from FirstActivity"); StartActivity (typeof(SecondActivity)); }; } } ---Activity 2 [Activity (Label = "SecondActivity")] public class SecondActivity : Activity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); // Create your application here SetContentView (Resource.Layout.Second); var label = FindViewById (Resource.Id.screen2Label); label.Text = Intent.GetStringExtra("FirstData") ?? "Data not available"; } }
Thanks