Plugin.Geolocator exits method (deadlock?)Requesting single location update, AVD crasheshow to disable location services in my WP7 appHow can I get the HTML5 GeoLocation feature to work on GeckoFX v22 web browser control for WinForms using C#?geolocation.watchposition not working with network based location offGeo Location not accessible from a webpage on Android when using browser embedded in an appXamarin Android : Read and write files on USB stickIGeolocator's PositionChanged firing twice?Freezing on permission request Xamarin.FormsXamarin Android - Write to file - access deniedxamarin iOS ONLY Plugin.Geolocator Authorization Error

Use cases for M-0 & C-0?

How acidic does a mixture have to be for milk to curdle?

How to store my pliers and wire cutters on my desk?

Aftermath of nuclear disaster at Three Mile Island

Would all these three things have the exact same effect on the flight duration of a glider?

Make AES more secure by randomising the blocks in an encrypted file

Send a single HTML email from Thunderbird, overriding the default "plain text" setting

How to kill my goat in Goat Simulator

Why was Sauron preparing for war instead of trying to find the ring?

Assuring luggage isn't lost with short layover

How much were the LMs maneuvered to their landing points?

Decreasing star size

Trapped in an ocean Temple in Minecraft?

The Sword in the Stone

If my pay period is split between 2 calendar years, which tax year do I file them in?

kids pooling money for Lego League and taxes

Is it possible to pass "draft" option to documentclass with arara?

Is there a reason why I should not use the HaveIBeenPwned API to warn users about exposed passwords?

Am I allowed to use personal conversation as a source?

What is the use of で in this sentence?

Can you type a tilde on the key under ESC on a European ISO keyboard set to US

How do campaign rallies gain candidates votes?

How did Mysterio have these drones?

What to do when you reach a conclusion and find out later on that someone else already did?



Plugin.Geolocator exits method (deadlock?)


Requesting single location update, AVD crasheshow to disable location services in my WP7 appHow can I get the HTML5 GeoLocation feature to work on GeckoFX v22 web browser control for WinForms using C#?geolocation.watchposition not working with network based location offGeo Location not accessible from a webpage on Android when using browser embedded in an appXamarin Android : Read and write files on USB stickIGeolocator's PositionChanged firing twice?Freezing on permission request Xamarin.FormsXamarin Android - Write to file - access deniedxamarin iOS ONLY Plugin.Geolocator Authorization Error






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm building a Xamarin app and for the geolocation, I'm using the GeolocatorPlugin



The problem is that once the code wants to get the position, the code exists without warning.



My class fields:



private Position position;
private IGeolocator locator = CrossGeolocator.Current;


My page constructor:



public MainPage()

InitializeComponent();

locator.PositionChanged += Locator_PositionChanged;
locator.PositionError += Locator_PositionError;



OnAppearing event is calling the getLocationPermission:



 private async Task GetLocationPermission()

var status = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationWhenInUse);
if (status != PermissionStatus.Granted)

//Not granted, request permission
if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.LocationWhenInUse))

// This is not the actual permission request
await DisplayAlert("Need your permission", "We need to access your location", "Ok");


// This is the actual permission request
var results = await CrossPermissions.Current.RequestPermissionsAsync(Permission.LocationWhenInUse);
if (results.ContainsKey(Permission.LocationWhenInUse))
status = results[Permission.LocationWhenInUse];

//Already granted, go on
if (status == PermissionStatus.Granted)

//Granted, get the location
GetLocation();
await GetVenues();
await locator.StartListeningAsync(TimeSpan.FromMinutes(30), 500);

else

await DisplayAlert("Access to location denied", "We don't have access to your location.", "OK");




The permission is granted and gets to the GetLocation() method:



 private async void GetLocation()

//var locator = CrossGeolocator.Current;
try

var myPosition = await locator.GetPositionAsync();
position = new Position(myPosition.Latitude, myPosition.Longitude);

catch (Exception ex)

throw;

if (position == null)

//Handle exception




Once the line is reached with locator.GetPositionAsync(), it stops. No exception is thrown, also the PositionError isn't raised.



I have no idea why, but in the beginning it worked once, never worked after that.



The location settings in de Android Emulator are as follow:



enter image description here










share|improve this question




























    0















    I'm building a Xamarin app and for the geolocation, I'm using the GeolocatorPlugin



    The problem is that once the code wants to get the position, the code exists without warning.



    My class fields:



    private Position position;
    private IGeolocator locator = CrossGeolocator.Current;


    My page constructor:



    public MainPage()

    InitializeComponent();

    locator.PositionChanged += Locator_PositionChanged;
    locator.PositionError += Locator_PositionError;



    OnAppearing event is calling the getLocationPermission:



     private async Task GetLocationPermission()

    var status = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationWhenInUse);
    if (status != PermissionStatus.Granted)

    //Not granted, request permission
    if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.LocationWhenInUse))

    // This is not the actual permission request
    await DisplayAlert("Need your permission", "We need to access your location", "Ok");


    // This is the actual permission request
    var results = await CrossPermissions.Current.RequestPermissionsAsync(Permission.LocationWhenInUse);
    if (results.ContainsKey(Permission.LocationWhenInUse))
    status = results[Permission.LocationWhenInUse];

    //Already granted, go on
    if (status == PermissionStatus.Granted)

    //Granted, get the location
    GetLocation();
    await GetVenues();
    await locator.StartListeningAsync(TimeSpan.FromMinutes(30), 500);

    else

    await DisplayAlert("Access to location denied", "We don't have access to your location.", "OK");




    The permission is granted and gets to the GetLocation() method:



     private async void GetLocation()

    //var locator = CrossGeolocator.Current;
    try

    var myPosition = await locator.GetPositionAsync();
    position = new Position(myPosition.Latitude, myPosition.Longitude);

    catch (Exception ex)

    throw;

    if (position == null)

    //Handle exception




    Once the line is reached with locator.GetPositionAsync(), it stops. No exception is thrown, also the PositionError isn't raised.



    I have no idea why, but in the beginning it worked once, never worked after that.



    The location settings in de Android Emulator are as follow:



    enter image description here










    share|improve this question
























      0












      0








      0








      I'm building a Xamarin app and for the geolocation, I'm using the GeolocatorPlugin



      The problem is that once the code wants to get the position, the code exists without warning.



      My class fields:



      private Position position;
      private IGeolocator locator = CrossGeolocator.Current;


      My page constructor:



      public MainPage()

      InitializeComponent();

      locator.PositionChanged += Locator_PositionChanged;
      locator.PositionError += Locator_PositionError;



      OnAppearing event is calling the getLocationPermission:



       private async Task GetLocationPermission()

      var status = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationWhenInUse);
      if (status != PermissionStatus.Granted)

      //Not granted, request permission
      if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.LocationWhenInUse))

      // This is not the actual permission request
      await DisplayAlert("Need your permission", "We need to access your location", "Ok");


      // This is the actual permission request
      var results = await CrossPermissions.Current.RequestPermissionsAsync(Permission.LocationWhenInUse);
      if (results.ContainsKey(Permission.LocationWhenInUse))
      status = results[Permission.LocationWhenInUse];

      //Already granted, go on
      if (status == PermissionStatus.Granted)

      //Granted, get the location
      GetLocation();
      await GetVenues();
      await locator.StartListeningAsync(TimeSpan.FromMinutes(30), 500);

      else

      await DisplayAlert("Access to location denied", "We don't have access to your location.", "OK");




      The permission is granted and gets to the GetLocation() method:



       private async void GetLocation()

      //var locator = CrossGeolocator.Current;
      try

      var myPosition = await locator.GetPositionAsync();
      position = new Position(myPosition.Latitude, myPosition.Longitude);

      catch (Exception ex)

      throw;

      if (position == null)

      //Handle exception




      Once the line is reached with locator.GetPositionAsync(), it stops. No exception is thrown, also the PositionError isn't raised.



      I have no idea why, but in the beginning it worked once, never worked after that.



      The location settings in de Android Emulator are as follow:



      enter image description here










      share|improve this question














      I'm building a Xamarin app and for the geolocation, I'm using the GeolocatorPlugin



      The problem is that once the code wants to get the position, the code exists without warning.



      My class fields:



      private Position position;
      private IGeolocator locator = CrossGeolocator.Current;


      My page constructor:



      public MainPage()

      InitializeComponent();

      locator.PositionChanged += Locator_PositionChanged;
      locator.PositionError += Locator_PositionError;



      OnAppearing event is calling the getLocationPermission:



       private async Task GetLocationPermission()

      var status = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.LocationWhenInUse);
      if (status != PermissionStatus.Granted)

      //Not granted, request permission
      if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.LocationWhenInUse))

      // This is not the actual permission request
      await DisplayAlert("Need your permission", "We need to access your location", "Ok");


      // This is the actual permission request
      var results = await CrossPermissions.Current.RequestPermissionsAsync(Permission.LocationWhenInUse);
      if (results.ContainsKey(Permission.LocationWhenInUse))
      status = results[Permission.LocationWhenInUse];

      //Already granted, go on
      if (status == PermissionStatus.Granted)

      //Granted, get the location
      GetLocation();
      await GetVenues();
      await locator.StartListeningAsync(TimeSpan.FromMinutes(30), 500);

      else

      await DisplayAlert("Access to location denied", "We don't have access to your location.", "OK");




      The permission is granted and gets to the GetLocation() method:



       private async void GetLocation()

      //var locator = CrossGeolocator.Current;
      try

      var myPosition = await locator.GetPositionAsync();
      position = new Position(myPosition.Latitude, myPosition.Longitude);

      catch (Exception ex)

      throw;

      if (position == null)

      //Handle exception




      Once the line is reached with locator.GetPositionAsync(), it stops. No exception is thrown, also the PositionError isn't raised.



      I have no idea why, but in the beginning it worked once, never worked after that.



      The location settings in de Android Emulator are as follow:



      enter image description here







      xamarin geolocation






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 18:50









      CyclingFreakCyclingFreak

      8292 gold badges12 silver badges33 bronze badges




      8292 gold badges12 silver badges33 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Based on my research, you did not acheved that Location Changes like this link



          I wrote a demo about Location changes. This is running screenshot.



          enter image description here



          This is my demo
          https://github.com/851265601/GeolocationDemo






          share|improve this answer























          • Instead of a class locator field, I now get the position from CrossGeoLocator.Current. It now fires two times a position change, but when I change the location, it doesn't fire anymore.

            – CyclingFreak
            Mar 27 at 9:02











          • Did you run my demo?

            – Leon Lu - MSFT
            Mar 27 at 9:08











          • Did you add if (CrossGeolocator.Current.IsListening) return; await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(3), 10, true); in your project

            – Leon Lu - MSFT
            Mar 27 at 9:10











          • You can upload your project in github, I can help you to test it.

            – Leon Lu - MSFT
            Mar 27 at 9:12












          • @CyclingFreak Are there any updates for this issue? If the reply is helpful, please try to mark it as an answer, it will help others who have similar issue.

            – Leon Lu - MSFT
            Mar 27 at 9:56











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55364341%2fplugin-geolocator-exits-method-deadlock%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Based on my research, you did not acheved that Location Changes like this link



          I wrote a demo about Location changes. This is running screenshot.



          enter image description here



          This is my demo
          https://github.com/851265601/GeolocationDemo






          share|improve this answer























          • Instead of a class locator field, I now get the position from CrossGeoLocator.Current. It now fires two times a position change, but when I change the location, it doesn't fire anymore.

            – CyclingFreak
            Mar 27 at 9:02











          • Did you run my demo?

            – Leon Lu - MSFT
            Mar 27 at 9:08











          • Did you add if (CrossGeolocator.Current.IsListening) return; await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(3), 10, true); in your project

            – Leon Lu - MSFT
            Mar 27 at 9:10











          • You can upload your project in github, I can help you to test it.

            – Leon Lu - MSFT
            Mar 27 at 9:12












          • @CyclingFreak Are there any updates for this issue? If the reply is helpful, please try to mark it as an answer, it will help others who have similar issue.

            – Leon Lu - MSFT
            Mar 27 at 9:56
















          0














          Based on my research, you did not acheved that Location Changes like this link



          I wrote a demo about Location changes. This is running screenshot.



          enter image description here



          This is my demo
          https://github.com/851265601/GeolocationDemo






          share|improve this answer























          • Instead of a class locator field, I now get the position from CrossGeoLocator.Current. It now fires two times a position change, but when I change the location, it doesn't fire anymore.

            – CyclingFreak
            Mar 27 at 9:02











          • Did you run my demo?

            – Leon Lu - MSFT
            Mar 27 at 9:08











          • Did you add if (CrossGeolocator.Current.IsListening) return; await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(3), 10, true); in your project

            – Leon Lu - MSFT
            Mar 27 at 9:10











          • You can upload your project in github, I can help you to test it.

            – Leon Lu - MSFT
            Mar 27 at 9:12












          • @CyclingFreak Are there any updates for this issue? If the reply is helpful, please try to mark it as an answer, it will help others who have similar issue.

            – Leon Lu - MSFT
            Mar 27 at 9:56














          0












          0








          0







          Based on my research, you did not acheved that Location Changes like this link



          I wrote a demo about Location changes. This is running screenshot.



          enter image description here



          This is my demo
          https://github.com/851265601/GeolocationDemo






          share|improve this answer













          Based on my research, you did not acheved that Location Changes like this link



          I wrote a demo about Location changes. This is running screenshot.



          enter image description here



          This is my demo
          https://github.com/851265601/GeolocationDemo







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 27 at 3:22









          Leon Lu - MSFTLeon Lu - MSFT

          1,8771 gold badge2 silver badges6 bronze badges




          1,8771 gold badge2 silver badges6 bronze badges












          • Instead of a class locator field, I now get the position from CrossGeoLocator.Current. It now fires two times a position change, but when I change the location, it doesn't fire anymore.

            – CyclingFreak
            Mar 27 at 9:02











          • Did you run my demo?

            – Leon Lu - MSFT
            Mar 27 at 9:08











          • Did you add if (CrossGeolocator.Current.IsListening) return; await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(3), 10, true); in your project

            – Leon Lu - MSFT
            Mar 27 at 9:10











          • You can upload your project in github, I can help you to test it.

            – Leon Lu - MSFT
            Mar 27 at 9:12












          • @CyclingFreak Are there any updates for this issue? If the reply is helpful, please try to mark it as an answer, it will help others who have similar issue.

            – Leon Lu - MSFT
            Mar 27 at 9:56


















          • Instead of a class locator field, I now get the position from CrossGeoLocator.Current. It now fires two times a position change, but when I change the location, it doesn't fire anymore.

            – CyclingFreak
            Mar 27 at 9:02











          • Did you run my demo?

            – Leon Lu - MSFT
            Mar 27 at 9:08











          • Did you add if (CrossGeolocator.Current.IsListening) return; await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(3), 10, true); in your project

            – Leon Lu - MSFT
            Mar 27 at 9:10











          • You can upload your project in github, I can help you to test it.

            – Leon Lu - MSFT
            Mar 27 at 9:12












          • @CyclingFreak Are there any updates for this issue? If the reply is helpful, please try to mark it as an answer, it will help others who have similar issue.

            – Leon Lu - MSFT
            Mar 27 at 9:56

















          Instead of a class locator field, I now get the position from CrossGeoLocator.Current. It now fires two times a position change, but when I change the location, it doesn't fire anymore.

          – CyclingFreak
          Mar 27 at 9:02





          Instead of a class locator field, I now get the position from CrossGeoLocator.Current. It now fires two times a position change, but when I change the location, it doesn't fire anymore.

          – CyclingFreak
          Mar 27 at 9:02













          Did you run my demo?

          – Leon Lu - MSFT
          Mar 27 at 9:08





          Did you run my demo?

          – Leon Lu - MSFT
          Mar 27 at 9:08













          Did you add if (CrossGeolocator.Current.IsListening) return; await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(3), 10, true); in your project

          – Leon Lu - MSFT
          Mar 27 at 9:10





          Did you add if (CrossGeolocator.Current.IsListening) return; await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(3), 10, true); in your project

          – Leon Lu - MSFT
          Mar 27 at 9:10













          You can upload your project in github, I can help you to test it.

          – Leon Lu - MSFT
          Mar 27 at 9:12






          You can upload your project in github, I can help you to test it.

          – Leon Lu - MSFT
          Mar 27 at 9:12














          @CyclingFreak Are there any updates for this issue? If the reply is helpful, please try to mark it as an answer, it will help others who have similar issue.

          – Leon Lu - MSFT
          Mar 27 at 9:56






          @CyclingFreak Are there any updates for this issue? If the reply is helpful, please try to mark it as an answer, it will help others who have similar issue.

          – Leon Lu - MSFT
          Mar 27 at 9:56









          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55364341%2fplugin-geolocator-exits-method-deadlock%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해