Statistiques
| Branche: | Révision:

teotestbluetooth / TestXamConnections / TestXamConnections.Android / MainActivity.cs @ 340558f2

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

1 3fa496d6 Martin Toutant

2 3c62e059 Martin Toutant
using Android.App;
3
using Android.Content.PM;
4
using Android.Runtime;
5
using Android.OS;
6
using Xamarin.Forms;
7 91ef3e8c Martin Toutant
using TestXamConnections.Services;
8
using TestXamConnections.Connection;
9
using TestBLE.Droid.Helper;
10
using TestXamConnections.Droid.Services;
11 3c62e059 Martin Toutant
12 91ef3e8c Martin Toutant
namespace TestXamConnections.Droid
13 3c62e059 Martin Toutant
{
14 1fd64302 Martin Toutant
    [Activity(Label = "TestXamConnections", Icon = "@mipmap/myicon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
15 3c62e059 Martin Toutant
    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 0875d625 Martin Toutant
            Forms.Init(this, savedInstanceState);
23 340558f2 martin.toutant
            DependencyService.RegisterSingleton<IConnexionServiceFournisseur>(new ConnexionServiceFournisseur());
24 91ef3e8c Martin Toutant
            DependencyService.RegisterSingleton<IBluetoothService>(new BluetoothService());
25 3c62e059 Martin Toutant
            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
}