Created
October 7, 2017 09:16
-
-
Save wuhuangjia/67f0bff59b0bdbfcdab96444931a9b46 to your computer and use it in GitHub Desktop.
Medium 文章:Xamarin + Prism + Firebase Analytics_MainActivity.cs
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.PM; | |
using Android.Runtime; | |
using Android.Views; | |
using Android.Widget; | |
using Android.OS; | |
using Prism.Unity; | |
using Microsoft.Practices.Unity; | |
using Firebase.Analytics; | |
namespace XFFirebase.Droid | |
{ | |
[Activity(Label = "XFFirebase", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] | |
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity | |
{ | |
FirebaseAnalytics firebaseAnalytics; | |
protected override void OnCreate(Bundle bundle) | |
{ | |
TabLayoutResource = Resource.Layout.tabs; | |
ToolbarResource = Resource.Layout.toolbar; | |
base.OnCreate(bundle); | |
firebaseAnalytics = FirebaseAnalytics.GetInstance(this); | |
global::Xamarin.Forms.Forms.Init(this, bundle); | |
LoadApplication(new App(new AndroidInitializer())); | |
} | |
} | |
public class AndroidInitializer : IPlatformInitializer | |
{ | |
public void RegisterTypes(IUnityContainer container) | |
{ | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment