For this exercise, you're creating a new Android solution and performing several basic functions using an Android emulator. Again, your app will focus on handling hardware state changes and user interactions with your Activity:
Create a new solution.
From the Android group, select the Android Ice Cream Sandwich Application template.
Name your project
AndroidInMotion
and click the OK button.Your solution should have opened to the
MainActivity.cs
file. If not, open that file now.Delete this line of code from the
MainActivity.cs
file:Int count = 1;
Replace all of the code in the
OnCreate()
method with the following code:base.OnCreate (bundle); var relLayout = new RelativeLayout (this); var layoutParams = new RelativeLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent); relLayout.LayoutParameters = layoutParams; var orientation = WindowManager.DefaultDisplay.Rotation; RelativeLayout.LayoutParams textViewLayoutParams; if (orientation...