Statistiques
| Branche: | Révision:

teotestbluetooth / TestTeoBluetooth / TestTeoBluetooth.Android / MainActivity.cs @ 4ca686e8

Historique | Voir | Annoter | Télécharger (1,332 ko)

1
using System;
2

    
3
using Android.App;
4
using Android.Content.PM;
5
using Android.Runtime;
6
using Android.OS;
7
using Xamarin.Forms;
8
using TeoTestBluetooth.Services;
9

    
10
namespace TeoTestBluetooth.Droid
11
{
12
    [Activity(Label = "TestBLE", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
13
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
14
    {
15
        protected override void OnCreate(Bundle savedInstanceState)
16
        {
17
            base.OnCreate(savedInstanceState);
18

    
19
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
20
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
21
            DependencyService.RegisterSingleton<IBluetoothService>(new Services.BluetoothService());
22
            LoadApplication(new App());
23
        }
24
        public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
25
        {
26
            Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
27

    
28
            base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
29
        }
30
    }
31
}