Skip to content

Instantly share code, notes, and snippets.

@Arpit360 Arpit360/HelloAndroid Secret
Created Aug 1, 2016

Embed
What would you like to do?
using Android.App;
using Android.Widget;
using Android.OS;
var rootActivity= StartedActivities.FirstOrDefault();
var layout = new LinearLayout(rootActivity);
layout.Orientation = Orientation.Vertical;
var aLabel = new TextView(rootActivity);
aLabel.Text = "Hello, World!!!";
var aButton = new Button(rootActivity);
aButton.Text = "Say Hello!";
aButton.Click += (sender, e) =>
{ aLabel.Text = "Hello Android!"; };
layout.AddView(aLabel);
layout.AddView(aButton);
rootActivity.SetContentView(layout);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.