I use the CountryCodePicker from the CountryCodePickerProject by hbb20.
I get the User's data from the DataBase, and sometimes for whatever reason the User has "" (empty string) saved as their country.
I use this Picker to edit their country, and if the User does not change his country then I get India "IN" as the selectedCCPCountry since the defaultCCPCountry automatically returns India if no country was set.
How can I set the selectedCCPCountry or some other flag to null or "" so that in this case I can know not to change the User's data?
Thanks!
So I created an issue for this on GitHub and got a quick response from the author:
Here is my response and my temporary workaround:
As I don't want to undo all the code I have already, I made a temporary workaround. mCountryChangedByUser is false and turns true only when a country is selected inside the CountryCodePicker.
If the user did not change his country then just return the original country in my saveUser() function.
if (mCountryChangedByUser) {
Maybe next time I'll use the AndroidCountryPicker.
Thanks!