|
15 | 15 | package com.firebase.ui.auth.util.signincontainer;
|
16 | 16 |
|
17 | 17 | import android.app.PendingIntent;
|
| 18 | +import android.content.Context; |
18 | 19 | import android.content.Intent;
|
19 | 20 | import android.content.IntentSender;
|
20 | 21 | import android.net.Uri;
|
@@ -49,6 +50,8 @@ public class SaveSmartLock extends SmartLockBase<Status> {
|
49 | 50 | private static final int RC_SAVE = 100;
|
50 | 51 | private static final int RC_UPDATE_SERVICE = 28;
|
51 | 52 |
|
| 53 | + private Context mAppContext; |
| 54 | + |
52 | 55 | private String mName;
|
53 | 56 | private String mEmail;
|
54 | 57 | private String mPassword;
|
@@ -77,6 +80,12 @@ public static SaveSmartLock getInstance(FragmentActivity activity, FlowParameter
|
77 | 80 | return result;
|
78 | 81 | }
|
79 | 82 |
|
| 83 | + @Override |
| 84 | + public void onAttach(Context context) { |
| 85 | + super.onAttach(context); |
| 86 | + mAppContext = context.getApplicationContext(); |
| 87 | + } |
| 88 | + |
80 | 89 | @Override
|
81 | 90 | public void onConnected(Bundle bundle) {
|
82 | 91 | if (TextUtils.isEmpty(mEmail)) {
|
@@ -205,7 +214,7 @@ public void saveCredentialsOrFinish(FirebaseUser firebaseUser,
|
205 | 214 | mProfilePictureUri = firebaseUser.getPhotoUrl() != null ? firebaseUser.getPhotoUrl()
|
206 | 215 | .toString() : null;
|
207 | 216 |
|
208 |
| - mGoogleApiClient = new Builder(getContext().getApplicationContext()) |
| 217 | + mGoogleApiClient = new Builder(mAppContext) |
209 | 218 | .addConnectionCallbacks(this)
|
210 | 219 | .addOnConnectionFailedListener(this)
|
211 | 220 | .addApi(Auth.CREDENTIALS_API)
|
|
0 commit comments