This is my variable:
public class List extends Activity {
double lat;
double lon;
public class MyLocationListener implements LocationListener{
@Override
public void onLocationChanged(Location loc){
lat = loc.getLatitude();
lon = loc.getLongitude();
}
.......
}
I want to get the lat and lon values here:
public class AmbilData extends AsyncTask<String, String, String> {
.....
protected String doInBackground(String... arg0) {
// TODO Auto-generated method stub
String url;
url = "http://anjayanjay.esy.es?lat="+lat+"&lon="+lon; //here i need the variable value
.......................
}
I'm new in using android studio, this code has lat = 0, and lon = 0 when I ran it. Could someone tell me how to fix this?