通知在textview中更改了哪些文本

时间:2018-12-13 17:12:44

标签: java android

如何通知对话框中的文本已更改?

我正在制作指纹,当指纹成功时,我想交换在其文本视图中显示的消息。

public void showDialog(){
        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(getActivity());
        LayoutInflater inflater = this.getLayoutInflater();
        View dialogView = inflater.inflate(R.layout.alert_dialog_digital, null);
        TextView textFinger = dialogView.findViewById(R.id.text_finger);
        dialogBuilder.setView(dialogView);
        alertDialog = dialogBuilder.create();
        alertDialog.show();
        textFinger.setText(texto);
        dialogView.findViewById(R.id.buttonCancelar).setOnClickListener(view -> {
            fingerPrintAuthHelper.stopAuth();
            alertDialog.dismiss();
        });
}

@Override
public void onAuthSuccess(FingerprintManager.CryptoObject cryptoObject) {
    texto = "Sucesso";
    alertDialog.show();
    presenter.sendData(bundle.getString(USER), bundle.getString(PASS));
    FragmentUtils.navigateTo(getActivity(), TermsOfUseFragment.TAG, new TermsOfUseFragment(), R.id.fragmentContainer);
}

1 个答案:

答案 0 :(得分:0)

@Override
public void onAuthSuccess(FingerprintManager.CryptoObject cryptoObject) {
    texto = "Sucesso";
    textFinger.setText(texto); //Change to this
    presenter.sendData(bundle.getString(USER), bundle.getString(PASS));
    FragmentUtils.navigateTo(getActivity(), TermsOfUseFragment.TAG, new TermsOfUseFragment(), R.id.fragmentContainer);
}