XPopup
XPopup copied to clipboard
show() 不弹出弹窗
XPopup版本 如2.8.14
手机系统和型号 reame x7
描述你的问题 class WalletPayMoneyNumberDialog( var mConext: Context, var walletSelectPayListener: WalletSelectPayListener?, var bagEntity: BagWalletCredits? ) : BottomPopupView(mConext) { }
fun shoppingcartShowWallet( mContext: Context?, mLifecycle: Lifecycle?, isDismissOnTouchOutside: Boolean = false, viewMode: Boolean = false, isDestroyOnDismiss: Boolean = false, walletSelectPayListener: WalletSelectPayListener?, bagResultBean: BagWalletCredits? ): BasePopupView? { mContext?.let { return XPopup.Builder(mContext) .customHostLifecycle(mLifecycle) .dismissOnTouchOutside(isDismissOnTouchOutside) .isViewMode(viewMode) //开启View实现 .isDestroyOnDismiss(isDestroyOnDismiss) .asCustom( WalletPayMoneyNumberDialog(mContext, walletSelectPayListener, bagResultBean) ) } return null }
if (walletPayDialog == null) { KlogUtils.e("走是空的"+bagWalletCredits); walletPayDialog = (WalletPayMoneyNumberDialog) XpopDialogUtils.Companion.shoppingcartShowWallet(getActivity(), getLifecycle(), true, true, false, new WalletSelectPayListener() { @Override public void haveQuestionListener(@Nullable BasePopupView mDialog, @Nullable String questionStr) { if (!TextUtils.isEmpty(questionStr)){ showInsuranceDialog(questionStr); } }
@Override
public void applyListener(@Nullable BasePopupView mDialog, @Nullable String selectNumber) {
KlogUtils.e("LGS可以点击" + selectNumber);
if (!TextUtils.isEmpty(selectNumber)) {
changeWalletAmount(selectNumber, mDialog,isChecked);
}
}
}, bagWalletCredits);
} else {
KlogUtils.e("不走这个回调了吗");
walletPayDialog.setBagEntityData(bagWalletCredits);
}
if (walletPayDialog != null) {
KlogUtils.e("不空试试");
walletPayDialog.show();
}
好神奇,不进入别的页面,第二次也能show出来,但是一旦进入到别的页面只有就show不起来了 代码也走了show()方法中的 if (popupStatus == PopupStatus.Showing || popupStatus == PopupStatus.Dismissing) return this; 但是就是弹窗弹不出来
把customLifecycle去掉试试
把customLifecycle去掉仍旧无效
没明白你的逻辑,你是先show,然后进入别的Activity,这时候显示不出来吗?