- Xamarin Blueprints
- Michael Williams
- 124字
- 2021-07-08 11:48:22
Setting up the SpeechTalk.Droid project
Let's do the same for Android and set up Xamarin.Forms
accordingly. Inside our Android project, open the MainActivity.cs
class and look at the OnCreate
function:
[Activity (Label = "SpeechTalk.Droid", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); global::Xamarin.Forms.Forms.Init (this, bundle); LoadApplication (new App ()); } }
The MainActivity
class must inherit Xamarin.Forms.Platform.Android.FormsApplicationActivity
; we must call the super class OnCreate
method before we initialize Xamarin.Forms
and load in our new instantiated app class. That's all, we can now run the Android application and see the exact same results, a blank page. Congratulations, you have just shared your first Xamarin.Forms
interface.
推薦閱讀
- Flink SQL與DataStream入門、進(jìn)階與實(shí)戰(zhàn)
- Java Web應(yīng)用開發(fā)技術(shù)與案例教程(第2版)
- Python貝葉斯分析(第2版)
- Java Web開發(fā)詳解
- 時(shí)空數(shù)據(jù)建模及其應(yīng)用
- Python青少年趣味編程
- Moodle 3 Administration(Third Edition)
- Java設(shè)計(jì)模式深入研究
- MongoDB Administrator’s Guide
- LabVIEW入門與實(shí)戰(zhàn)開發(fā)100例(第4版)
- Web前端開發(fā)技術(shù)實(shí)踐指導(dǎo)教程
- Scratch超人漫游記:創(chuàng)意程序設(shè)計(jì):STEAM創(chuàng)新教育指南
- Unity Certified Programmer:Exam Guide
- R Data Visualization Cookbook
- Oracle 11g寶典