I'm not great with android so I'm just going to ask you this:
I want to transfer some "data" (GPS Coordinates) from my location listener to a string, that will be used in an onClick function. Such as:
case R.id.sendButton:
ParsePush push = new ParsePush();
String message = "Hey, My coordinates are - LONG:" + loc.getLongitude();;
push.setChannel("test1");
push.setMessage(message);
push.sendInBackground();
break;
Yes, I DO have a location listener:
class MyLocationListener implements LocationListener {
@Override
public void onLocationChanged(Location loc) {
mlocation.setText("");
Toast.makeText(
getBaseContext(),
"Location changed: Lat: " + loc.getLatitude() + " Lng: "
+ loc.getLongitude(), Toast.LENGTH_SHORT).show();
String longitude = "Longitude: " + loc.getLongitude();
Log.v("Long", longitude);
String latitude = "Latitude: " + loc.getLatitude();
Log.v("Lat", latitude);
ETC....
So basically, I want to be able to set my longitude to a certain variable(string) and use that string in my onClick button.
How can I do this? Any links whatsoever would be great. Thanks!