I want to display a toast if the map view gets focus. What I've been able to do so far is:
mapView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
Toast.makeText(getApplicationContext(), "Tem o foco", Toast.LENGTH_SHORT).show();
}
}
});
But it seems that just rolling the screen does not focus on the component. How to proceed?