Dismiss上的Android DialogFragment在Activity上留下透明视图,必须返回按钮以删除透明视图

时间:2015-10-15 22:18:12

标签: android android-layout android-fragments

如果项目project_name已经存在,我有一个Activity来启动DialogFragment。覆盖或取消。

    if (newdir.exists()) {
            android.app.FragmentManager fm = getFragmentManager();

        overWriteDirectoryDialog = new OverWriteDirectoryDialogFragment();

        // set up the bundle to pass to the DialogFragment
        Bundle args = new Bundle();
        args.putString("file_name", file_name);
        overWriteDirectoryDialog.setArguments(args);

        overWriteDirectoryDialog.setRetainInstance(true);
        overWriteDirectoryDialog.show(fm, "fragment_name");
    }

如果用户选择" OverWrite",DialogFragment关闭,允许项目在Activity中进行,但半透明视图或某些内容涵盖Activity,并且不允许与活动,直到按下后退按钮,此时半透明视图消失,一切正常。

.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    try {

                        ((FrameSliderActivity) getActivity()).deleteDirectory();
                        dismiss();

                    } catch (NumberFormatException ex) {
                        ((FrameSliderActivity) getActivity()).tToast("Something has gone horribly Wrong!");
                        //((FrameSliderActivity) getActivity()).createProject();
                    }
                }

            })

知道造成这种情况的原因是什么?

我需要超过10个声望点来上传mor而不是2个链接。

After clicking ok in the DialogFragment, But I cannot interact through the onTouch in this screen, adb shows a touch_down

After the back button is pressed, I have the expected behavior.

0 个答案:

没有答案