shernandezp / XamarinForms.LocationService

MAUI Background Services, Background Location Updates, Location Updates, BroadCastReceiver
https://github.com/shernandezp
Apache License 2.0
71 stars 25 forks source link

Could you explain this code from MainActivity.cs #8

Closed Davester34 closed 3 years ago

Davester34 commented 3 years ago
        serviceIntent = new Intent(this, typeof(AndroidLocationService));
        SetServiceMethods();

        if (Build.VERSION.SdkInt >= BuildVersionCodes.M && !Android.Provider.Settings.CanDrawOverlays(this))
        {
            var intent = new Intent(Android.Provider.Settings.ActionManageOverlayPermission);
            intent.SetFlags(ActivityFlags.NewTask);
            this.StartActivity(intent);
        }

Thanks in advance!!

pytchoun commented 3 years ago

Hey if you can explain the whole code i will be happy :(

shernandezp commented 3 years ago
        serviceIntent = new Intent(this, typeof(AndroidLocationService));
        SetServiceMethods();

        if (Build.VERSION.SdkInt >= BuildVersionCodes.M && !Android.Provider.Settings.CanDrawOverlays(this))
        {
            var intent = new Intent(Android.Provider.Settings.ActionManageOverlayPermission);
            intent.SetFlags(ActivityFlags.NewTask);
            this.StartActivity(intent);
        }

Thanks in advance!!

https://stackoverflow.com/questions/6391902/how-do-i-start-my-app-on-startup/11863951