Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fui_welcome_back_password_prompt_layout); if (savedInstanceState != null) { mPendingPassword = savedInstanceState.getString(ExtraConstants.EXTRA_PASSWORD, null); <START> } <END> getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); mIdpResponse = IdpResponse.fromResultIntent(getIntent()); mEmail = mIdpResponse.getEmail(); mPasswordLayout = findViewById(R.id.password_layout); mPasswordField = findViewById(R.id.password); ImeHelper.setImeOnDoneListener(mPasswordField, this); String bodyText = getString(R.string.fui_welcome_back_password_prompt_body, mEmail); SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(bodyText); int emailStart = bodyText.indexOf(mEmail); spannableStringBuilder.setSpan(new StyleSpan(Typeface.BOLD), emailStart, emailStart + mEmail.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); TextView bodyTextView = findViewById(R.id.welcome_back_password_body); bodyTextView.setText(spannableStringBuilder); findViewById(R.id.button_done).setOnClickListener(this); findViewById(R.id.trouble_signing_in).setOnClickListener(this); mHandler = ViewModelProviders.of(this).get(WelcomeBackPasswordHandler.class); mHandler.init(getFlowHolder().getArguments()); mHandler.getPendingResolution().observe(this, new Observer<PendingResolution>() { @Override public void onChanged(@Nullable PendingResolution resolution) { onPendingResolution(resolution); } }); mHandler.getSignInOperation().observe(this, new Observer<Resource<IdpResponse>>() { @Override public void onChanged(@Nullable Resource<IdpResponse> resource) { onSignInOperation(resource); } }); }</code><technical_language>fully understanding idea pending data, more sense in ViewModel? do..</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fui_welcome_back_password_prompt_layout); getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); mIdpResponse = IdpResponse.fromResultIntent(getIntent()); mEmail = mIdpResponse.getEmail(); mPasswordLayout = findViewById(R.id.password_layout); mPasswordField = findViewById(R.id.password); ImeHelper.setImeOnDoneListener(mPasswordField, this); String bodyText = getString(R.string.fui_welcome_back_password_prompt_body, mEmail); SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(bodyText); int emailStart = bodyText.indexOf(mEmail); spannableStringBuilder.setSpan(new StyleSpan(Typeface.BOLD), emailStart, emailStart + mEmail.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); TextView bodyTextView = findViewById(R.id.welcome_back_password_body); bodyTextView.setText(spannableStringBuilder); findViewById(R.id.button_done).setOnClickListener(this); findViewById(R.id.trouble_signing_in).setOnClickListener(this); mHandler = ViewModelProviders.of(this).get(WelcomeBackPasswordHandler.class); mHandler.init(getFlowHolder().getArguments()); mHandler.getSignInOperation().observe(this, new Observer<Resource<IdpResponse>>() { @Override public void onChanged(@Nullable Resource<IdpResponse> resource) { onSignInOperation(resource); } }); }