start navigating to position which is stored in database

后端 未结 3 742
孤城傲影
孤城傲影 2020-12-22 09:17

I have an application where I am getting the latitude and longitude coordinates.

I want , when to press a button to start navigating to that position .

Now ,

3条回答
  •  旧巷少年郎
    2020-12-22 10:20

    one possible way is to store your latitude and longitude values in shared preferences.

    -To store values you can use

     SharedPreferences sp = getSharedPreferences("MyPrefs", MODE_PRIVATE);
    
            Editor editor = sp.edit();
            editor.putString("mytext", text);
            editor.commit();
    

    -and to retrive those values you can use

    String value = prefs.getString("MyPrefs, "mytext");
    

    in your code your are storing latitude and longitudes in double do not forget to convert them in toString()...

    hope this helps

提交回复
热议问题