1 #region Copyright notice and license
2 // Copyright 2020 The gRPC Authors
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 #endregion
16 
17 using System;
18 
19 using Android.App;
20 using Android.Content.PM;
21 using Android.Runtime;
22 using Android.Views;
23 using Android.Widget;
24 using Android.OS;
25 
26 namespace HelloworldXamarin.Droid
27 {
28     [Activity(Label = "HelloworldXamarin", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
29     public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
30     {
OnCreate(Bundle savedInstanceState)31         protected override void OnCreate(Bundle savedInstanceState)
32         {
33             TabLayoutResource = Resource.Layout.Tabbar;
34             ToolbarResource = Resource.Layout.Toolbar;
35 
36             base.OnCreate(savedInstanceState);
37 
38             Xamarin.Essentials.Platform.Init(this, savedInstanceState);
39             global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
40             LoadApplication(new App());
41         }
OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)42         public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
43         {
44             Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
45 
46             base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
47         }
48     }
49 }
50