fix country selector on older androids

This commit is contained in:
Daniel Gultsch 2020-01-24 10:39:50 +01:00
parent 09dff6310d
commit 18a90fde8c
2 changed files with 4 additions and 4 deletions

View File

@ -10,12 +10,12 @@
<activity <activity
android:name=".ui.EnterPhoneNumberActivity" android:name=".ui.EnterPhoneNumberActivity"
android:label="@string/verify_your_phone_number" android:label="@string/verify_your_phone_number"
android:launchMode="singleTask" /> android:launchMode="singleTop" />
<activity <activity
android:name=".ui.ChooseCountryActivity" android:name=".ui.ChooseCountryActivity"
android:label="@string/choose_a_country" android:label="@string/choose_a_country"
android:launchMode="singleTask" /> android:launchMode="singleTop" />
<activity <activity
android:name=".ui.VerifyActivity" android:name=".ui.VerifyActivity"

View File

@ -170,7 +170,7 @@ public class EnterPhoneNumberActivity extends XmppActivity implements QuickConve
} }
private void onSelectCountryClick(View view) { private void onSelectCountryClick(View view) {
Intent intent = new Intent(this, ChooseCountryActivity.class); final Intent intent = new Intent(this, ChooseCountryActivity.class);
startActivityForResult(intent, REQUEST_CHOOSE_COUNTRY); startActivityForResult(intent, REQUEST_CHOOSE_COUNTRY);
} }
@ -194,7 +194,7 @@ public class EnterPhoneNumberActivity extends XmppActivity implements QuickConve
public void onActivityResult(int requestCode, int resultCode, final Intent data) { public void onActivityResult(int requestCode, int resultCode, final Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && requestCode == REQUEST_CHOOSE_COUNTRY) { if (resultCode == RESULT_OK && requestCode == REQUEST_CHOOSE_COUNTRY) {
String region = data.getStringExtra("region"); final String region = data.getStringExtra("region");
if (region != null) { if (region != null) {
this.region = region; this.region = region;
final int countryCode = PhoneNumberUtilWrapper.getInstance(this).getCountryCodeForRegion(region); final int countryCode = PhoneNumberUtilWrapper.getInstance(this).getCountryCodeForRegion(region);