Created
July 29, 2015 04:08
-
-
Save vkoppaka/2f179167aea3693761b0 to your computer and use it in GitHub Desktop.
Explicit Intent Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Android.App; | |
using Android.Content; | |
using Android.OS; | |
using Android.Widget; | |
namespace IntentsSamples | |
{ | |
[Activity(Label = "IntentsSamples", 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); | |
// Get our button from the layout resource, | |
// and attach an event to it | |
Button button = FindViewById<Button>(Resource.Id.MyButton); | |
button.Click += button_Click; | |
} | |
private void button_Click(object sender, EventArgs e) | |
{ | |
var detailsIntent = new Intent(this, typeof (DetailsActivity)); | |
StartActivity(detailsIntent); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment