Android Zoom Controls keep zooming in and will not stop
My zoom controls keep zooming in when I press the button, and will not stop, am I missing something?
zoomControls = (ZoomControls) findViewById(R.id.zoom);
zoomControls.setOnZoomInClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mc.zoomIn();
}
});
zoomControls.setOnZoomOutClickListener(new View.OnClickListener(开发者_如何学JAVA) {
@Override
public void onClick(View v) {
mc.zoomOut();
}
});
Taking an educated guess that mc
is a MapController
, perhaps calling zoomIn()
on a MapController
triggers the relevant OnClickListener
as well. Try logging every time you are in your onClick()
to see if you get a chain of log messages. If so, then you probably can't do what you're trying to do.
精彩评论