as doc says about removeUpdates(LocationListener listener) :
Removes any current registration for location updates of the current
activity with the given LocationListener.
Your Current Code only Removes any current registration for location updates of the current activity with the given LocationListener not STOP GPS or remove icon
from statusbar .so is you want to stop GPS then you have two solution
FIRST SOLUTION : stop by code (only work on below Android 2.3):
try{
String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
if(!provider.contains("gps")){
final Intent poke = new Intent();
poke.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");
poke.addCategory(Intent.CATEGORY_ALTERNATIVE);
poke.setData(Uri.parse("3"));
sendBroadcast(poke);
}
}
catch(Exception e)
{
Log.d("Location", " exception thrown in enabling GPS "+e);
}
Permission in Manifest.xml:
android.permission.WRITE_SECURE_SETTINGS
SECOND SOLUTION : launch Gps setting Activity:
startActivityForResult(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS), 1);