- 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.
推薦閱讀
- TypeScript Blueprints
- JavaScript高效圖形編程
- Microsoft Dynamics 365 Extensions Cookbook
- Offer來了:Java面試核心知識(shí)點(diǎn)精講(原理篇)
- Java FX應(yīng)用開發(fā)教程
- 云原生Spring實(shí)戰(zhàn)
- INSTANT MinGW Starter
- 從0到1:Python數(shù)據(jù)分析
- 小學(xué)生C++創(chuàng)意編程(視頻教學(xué)版)
- GameMaker Essentials
- UML2面向?qū)ο蠓治雠c設(shè)計(jì)(第2版)
- Deep Learning with R Cookbook
- C編程技巧:117個(gè)問題解決方案示例
- 深度學(xué)習(xí)程序設(shè)計(jì)實(shí)戰(zhàn)
- Getting Started with Electronic Projects