Skip to content

Instantly share code, notes, and snippets.

@vkoppaka
Created July 29, 2015 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vkoppaka/2f179167aea3693761b0 to your computer and use it in GitHub Desktop.
Save vkoppaka/2f179167aea3693761b0 to your computer and use it in GitHub Desktop.
Explicit Intent Sample
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