Created
May 8, 2013 03:56
-
-
Save iseebi/5538072 to your computer and use it in GitHub Desktop.
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.Runtime; | |
using Android.Views; | |
using Android.Widget; | |
using Android.OS; | |
namespace Test01a | |
{ | |
[Activity (Label = "Test01a", MainLauncher = true)] | |
public class Activity1 : Activity | |
{ | |
protected override void OnCreate (Bundle bundle) | |
{ | |
base.OnCreate (bundle); | |
SetContentView (Resource.Layout.MainContainer); | |
} | |
} | |
} | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent"> | |
<fragment | |
class="TestApp01.MainFragment" | |
android:id="@+id/fragment1" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> | |
</LinearLayout> |
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 System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Android.App; | |
using Android.Content; | |
using Android.OS; | |
using Android.Runtime; | |
using Android.Util; | |
using Android.Views; | |
using Android.Widget; | |
namespace Test01a | |
{ | |
public class MainFragment : Fragment | |
{ | |
int count = 1; | |
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) | |
{ | |
var rootView = inflater.Inflate(Resource.Layout.Main, container); | |
var button = rootView.FindViewById<Button> (Resource.Id.myButton); | |
button.Click += delegate { | |
button.Text = string.Format ("{0} clicks!", count++); | |
}; | |
return button; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment