Catch error message from server on recover with phone number
This commit is contained in:
parent
ec5317d02e
commit
24bce84c07
2 changed files with 9 additions and 4 deletions
|
@ -36,6 +36,7 @@ import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -45,7 +46,8 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
|
||||||
private EditText code;
|
private EditText code;
|
||||||
private boolean recoverAccount = false, linkAccount = false;
|
private boolean recoverAccount = false, linkAccount = false;
|
||||||
private int code_length;
|
private int code_length;
|
||||||
private Button checkAccount, back;
|
private ImageView back;
|
||||||
|
private Button checkAccount;
|
||||||
private LinphoneAccountCreator accountCreator;
|
private LinphoneAccountCreator accountCreator;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -66,8 +68,7 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
|
||||||
accountCreator.setUsername(username);
|
accountCreator.setUsername(username);
|
||||||
accountCreator.setPhoneNumber(phone, dialcode);
|
accountCreator.setPhoneNumber(phone, dialcode);
|
||||||
|
|
||||||
|
back = (ImageView) view.findViewById(R.id.back);
|
||||||
back = (Button) view.findViewById(R.id.cancel);
|
|
||||||
if (back != null)
|
if (back != null)
|
||||||
back.setVisibility(Button.INVISIBLE);
|
back.setVisibility(Button.INVISIBLE);
|
||||||
|
|
||||||
|
|
|
@ -364,8 +364,12 @@ public class LinphoneLoginFragment extends Fragment implements CompoundButton.On
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAccountCreatorPhoneAccountRecovered(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
public void onAccountCreatorPhoneAccountRecovered(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||||
|
if (status.equals(LinphoneAccountCreator.Status.ErrorServer)) {
|
||||||
|
LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForStatus(LinphoneAccountCreator.Status.Failed), AssistantActivity.instance());
|
||||||
|
} else {
|
||||||
AssistantActivity.instance().displayAssistantCodeConfirm(accountCreator.getUsername(), phoneNumberEdit.getText().toString(), LinphoneUtils.getCountryCode(dialCode), true);
|
AssistantActivity.instance().displayAssistantCodeConfirm(accountCreator.getUsername(), phoneNumberEdit.getText().toString(), LinphoneUtils.getCountryCode(dialCode), true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAccountCreatorIsAccountLinked(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
public void onAccountCreatorIsAccountLinked(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
|
||||||
|
|
Loading…
Reference in a new issue