画面遷移
こんな感じで画面遷移ができる 画面遷移先のActitityを用意しておくことが大切
using System; using Android.App; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; namespace App_naitive.Droid { [Activity (Label = "App_naitive.Android", MainLauncher = true, Icon = "@drawable/icon")] public class MainActivity : Activity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); Button btn = FindViewById<Button>(Resource.Id.button1); EditText eText = FindViewById<EditText>(Resource.Id.editText1); btn.Click += (sender, e) => { var intent = new Intent(this, typeof(Page2)); intent.SetData(Android.Net.Uri.Parse(eText.Text)); StartActivity(intent); }; Button btn2 = FindViewById<Button>(Resource.Id.button2); btn2.Click += (sender, e) => { var dialog = new AlertDialog.Builder(this); dialog.SetMessage("dialog:" + eText.Text); dialog.SetNeutralButton("dialog", delegate { var intent = new Intent(Intent.ActionCall); intent.SetData(Android.Net.Uri.Parse(eText.Text)); StartActivity(intent); }); dialog.SetNegativeButton("cancel", delegate { }); dialog.Show(); }; } } }