MoKee / android_packages_apps_WarpShare

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ShareActivity won't finish when no file can be send.

darkness463 opened this issue · comments

In org.mokee.warpshare.ShareBottomSheetFragment

    ....
    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
            ....
        if (mUris.isEmpty()) {
            Log.w(TAG, "No file was selected");
            Toast.makeText(getContext(), R.string.toast_no_file, Toast.LENGTH_SHORT).show();
            handleSendFailed();
            dismiss();
        }
    }

    @Override
    public void onDismiss(DialogInterface dialog) {
        super.onDismiss(dialog);
        if (mSending != null) {
            mSending.cancel();
            mSending = null;
        }
        mParent.finish();
    }

When no file can be send, dismiss() will be called. But onDismiss() won't be called because the dialog is not showing yet.