I have a code snippet as follows:
switch (status.getStatusCode()) {
case LocationSettingsStatusCodes.SUCCESS:
Log.d("Location", "onResult: success");
case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
Log.d(TAG, "onResult: resolution needed");
}
status.getStatusCode()
return an int and all constants are int s as well.
Before switch block I log 3 values status.getStatusCode()
is 0, LocationSettingsStatusCodes.SUCCESS
is 0 and LocationSettingsStatusCodes.RESOLUTION_REQUIRED
is 6.
But both Log.d
statements are executed. I don't think the problem is related to my code because I executed the same logic with if-else.
What can be the problem?