teotestbluetooth / TestTeoBluetooth / TestTeoBluetooth.Android / MainActivity.cs @ 91ef3e8c
Historique | Voir | Annoter | Télécharger (1,59 ko)
1 | 3c62e059 | Martin Toutant | 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 | 91ef3e8c | Martin Toutant | using TestXamConnections.Services; |
9 | using TestXamConnections.Droid.Connection; |
||
10 | using TestXamConnections.Connection; |
||
11 | using TestXamConnections.Helper; |
||
12 | using TestBLE.Droid.Helper; |
||
13 | using TestXamConnections.Droid.Services; |
||
14 | 3c62e059 | Martin Toutant | |
15 | 91ef3e8c | Martin Toutant | namespace TestXamConnections.Droid |
16 | 3c62e059 | Martin Toutant | { |
17 | [Activity(Label = "TestBLE", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )] |
||
18 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity |
||
19 | { |
||
20 | protected override void OnCreate(Bundle savedInstanceState) |
||
21 | { |
||
22 | base.OnCreate(savedInstanceState); |
||
23 | |||
24 | Xamarin.Essentials.Platform.Init(this, savedInstanceState); |
||
25 | 0875d625 | Martin Toutant | Forms.Init(this, savedInstanceState); |
26 | 91ef3e8c | Martin Toutant | DependencyService.RegisterSingleton<IConnectionServiceProvider>(new ConnectionServiceUpdater()); |
27 | DependencyService.RegisterSingleton<IBluetoothService>(new BluetoothService()); |
||
28 | 3c62e059 | Martin Toutant | LoadApplication(new App()); |
29 | } |
||
30 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults) |
||
31 | { |
||
32 | Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); |
||
33 | |||
34 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults); |
||
35 | } |
||
36 | } |
||
37 | } |