Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package com.firebase.ui.auth.ui.phone;

import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
Expand Down Expand Up @@ -52,6 +53,8 @@
public class VerifyPhoneNumberFragment extends FragmentBase implements View.OnClickListener {
public static final String TAG = "VerifyPhoneFragment";

private Context mAppContext;

private CountryListSpinner countryListSpinner;
private EditText mPhoneEditText;
private TextView errorEditText;
Expand All @@ -73,6 +76,12 @@ public static VerifyPhoneNumberFragment newInstance(FlowParameters flowParameter
return fragment;
}

@Override
public void onAttach(Context context) {
super.onAttach(context);
mAppContext = context.getApplicationContext();
}

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable
Expand Down Expand Up @@ -142,7 +151,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
final String formattedPhone =
PhoneNumberUtils
.formatPhoneNumberUsingCurrentCountry(unformattedPhone,
getContext());
mAppContext);
if (formattedPhone == null) {
Log.e(TAG, "Unable to normalize phone number from hint selector:"
+ unformattedPhone);
Expand Down