tests for activity result

This commit is contained in:
Philipp Crocoll 2014-05-21 06:48:49 +02:00
parent b2baa66b71
commit d3c67d7c5d
2 changed files with 13 additions and 5 deletions

View File

@ -34,12 +34,15 @@ namespace ArtTestApp
}
};
FindViewById<Button>(Resource.Id.MyButton2).Click += (sender, args) => StartActivityForResult(typeof(Activity2),1);
FindViewById<Button>(Resource.Id.MyButton2).Click += (sender, args) =>
{
Intent i = new Intent("blabla");
StartActivityForResult(i, 1);
};
FindViewById<Button>(Resource.Id.MyButton3).Click += (sender, args) => StartActivityForResult(typeof(PrefActivity), 1);
StartActivity(typeof(Activity2));
Finish();
}
}
}

View File

@ -5,6 +5,7 @@ using System.Text;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.OS;
using Android.Runtime;
using Android.Views;
@ -12,7 +13,11 @@ using Android.Widget;
namespace ArtTestApp
{
[Activity(Label = "My Activity")]
[Activity(Label = "Activity2",
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.KeyboardHidden)]
[IntentFilter(new[] { "blabla" },
Categories = new[] { Intent.CategoryDefault })]
public class Activity2 : Activity
{
protected override void OnCreate(Bundle bundle)