[android] Fixed the ingoring the onAuthorizationFinish callback because of PassportAuthDialogFragment wasn't subscribed

This commit is contained in:
Alexander Zatsepin 2018-05-30 19:20:50 +03:00 committed by yoksnod
parent 535831536d
commit 5efc2bb1f5

View file

@ -5,9 +5,6 @@ import android.os.Bundle;
import android.support.annotation.CallSuper;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.background.Notifier;
@ -21,16 +18,14 @@ public class PassportAuthDialogFragment extends BaseMwmDialogFragment
private final Authorizer mAuthorizer = new Authorizer(this);
@NonNull
private final AuthCallback mAuthCallback = new AuthCallback();
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState)
{
if (savedInstanceState == null)
mAuthorizer.authorize();
private Bundle mSavedInstanceState;
return null;
@Override
public void onCreate(@Nullable Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
mSavedInstanceState = savedInstanceState;
}
@Override
@ -39,6 +34,8 @@ public class PassportAuthDialogFragment extends BaseMwmDialogFragment
{
super.onStart();
mAuthorizer.attach(mAuthCallback);
if (mSavedInstanceState == null)
mAuthorizer.authorize();
}
@Override