Difficulty in sending location of user 1 to user 2 and user 2's location to user 1?

后端 未结 1 1012
面向向阳花
面向向阳花 2021-01-16 22:21

I have a code which sends location of user 1 to user 2 and user 2\'s location to user 1 . The location of user 1 is send perfectly to user 2 and user 2 is even sending a me

相关标签:
1条回答
  • 2021-01-16 22:52

    Well one problem you have is at line 102:

    String msg = Double.toString(latitude) + " " +Double.toString(longitude) ;
    

    You haven't updated latitude and longitude to reflect your current position. Add this code right before that line:

    latitude = location.getLatitude();
    longitude = location.getLongitude();
    

    See what happens once that is fixed.

    0 讨论(0)
提交回复
热议问题