teotestbluetooth / TestXamConnections / TestXamConnections.Android / MainActivity.cs @ 340558f2
Historique | Voir | Annoter | Télécharger (1,52 ko)
1 |
|
---|---|
2 |
using Android.App; |
3 |
using Android.Content.PM; |
4 |
using Android.Runtime; |
5 |
using Android.OS; |
6 |
using Xamarin.Forms; |
7 |
using TestXamConnections.Services; |
8 |
using TestXamConnections.Connection; |
9 |
using TestBLE.Droid.Helper; |
10 |
using TestXamConnections.Droid.Services; |
11 |
|
12 |
namespace TestXamConnections.Droid |
13 |
{ |
14 |
[Activity(Label = "TestXamConnections", Icon = "@mipmap/myicon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )] |
15 |
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity |
16 |
{ |
17 |
protected override void OnCreate(Bundle savedInstanceState) |
18 |
{ |
19 |
base.OnCreate(savedInstanceState); |
20 |
|
21 |
Xamarin.Essentials.Platform.Init(this, savedInstanceState); |
22 |
Forms.Init(this, savedInstanceState); |
23 |
DependencyService.RegisterSingleton<IConnexionServiceFournisseur>(new ConnexionServiceFournisseur()); |
24 |
DependencyService.RegisterSingleton<IBluetoothService>(new BluetoothService()); |
25 |
LoadApplication(new App()); |
26 |
} |
27 |
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults) |
28 |
{ |
29 |
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); |
30 |
|
31 |
base.OnRequestPermissionsResult(requestCode, permissions, grantResults); |
32 |
} |
33 |
} |
34 |
} |