This was created with guidance from Kaj (below)
Figured my problem out, but this may be useful for someone else looking to jump to current users location:
boolean touched = false;
if(touched == false){
mapController.animateTo(point);
}
myLocationBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
touched = false;
}
});
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView)
{
//---when user lifts his finger---
if (event.getAction() == 1) {
touched = true;
}
return false;
}
Your
onClickshould saytouched = "no";and notString touched = "no";. Btw, it’s probably better to change it to a boolean, so that you havetrue/false, instead of having strings.You should normally not compare strings with
==, usestring.equals(anotherString)instead.