Android google map on click of current location button show alert box if gps not enabled
问题 I have implemented Google map in my app. When i click on the current location button i wanted to show alert box if Gps is not enabled. I tried this way where i got the view of that button. SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); View plusMinusButton = fm.getView().findViewById(1); View locationButton = fm.getView().findViewById(2); Using that locationButton i tried to use setOnclickListener but that did not help. My requirement is