https://gist.github.com/adsl99801/a64698938d097bed612a#file-gistfile1-javaprivate void backKeyPressed(){backKeyPressedCount++;Utils.log("getBackStackEntryCount:" + getChildFragmentManager().getBackStackEntryCount()+",backKeyPressedCount:"+backKeyPressedCount);if (backKeyPressedCount<4) {getChildFragmentManager().popBackStack();showSecondLayout();return;}FinishAppListener finishAppListener = new FinishAppListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {if(which== AlertDialogWhich.Y){EventBus.getDefault().unregister(this);dialog.dismiss();getActivity().finish();}}};resetBackKeyPressedCount();Utils.showAlertDialog(v.getContext(), getResources().getString(R.string.askExistApp),finishAppListener);}
沒有留言:
張貼留言