joielechong / CountryCodePicker

Country Code Picker (CCP) is an android library which provides an easy way to search and select country phone code ( national code ) for the telephone number.
Apache License 2.0
317 stars 144 forks source link

Issue when selecting a country while registering EditText #30

Closed MalekKamel closed 6 years ago

MalekKamel commented 6 years ago

When you register EditText and try to select a country then validate the phone number, it always evaluates to false. After debugging, i found that after selecting a country, the mRegisteredPhoneNumberTextView points to selected_country_tv not the registered EditText. As a result, an exception, NumberParseException, occurs internally in getPhoneNumber() as the string is a code like this "+999".

Workaround: before calling `isValid(), i register the EditText.

joielechong commented 6 years ago

This bug is fixed on https://github.com/joielechong/CountryCodePicker/commit/6a080bf86375b195d6b6f4af34cd2d38e5c83f81 commit.

joielechong commented 6 years ago

Related issue #28