Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when showing the same builder two times #16

Closed
droididan opened this issue Aug 18, 2016 · 0 comments
Closed

Crash when showing the same builder two times #16

droididan opened this issue Aug 18, 2016 · 0 comments
Assignees
Labels

Comments

@droididan
Copy link

droididan commented Aug 18, 2016

Hello,

I built the Sheet and show it, then I want to update the title so I set the new title and rebuilt but I show for the second time I get crash:

log: "The specified child already has a parent. You must call removeView() on the child's parent first."

private void showNewEventSheet(String address, LatLng latLng) {
        if (mEventDialog == null) {
            mEventDialog = new BottomDialog.Builder(mActivity)
                    .setTitle(address)
                    .setContent(R.string.radius_content_message)
                    .setPositiveText(R.string.save)
                    .setNegativeText("Cancel")
                    .setCustomView(mSheetView)
                    .setCancelable(false)
                    .onPositive(bottomDialog -> {
                        new GeoModel(mRadius, latLng.latitude, latLng.longitude, address).save();
                        enterRadiusAndStayStillFence(latLng, mRadius);
                        getViewState().showFenceIndicate();
                        getViewState().showSettingsFab();
                    })
                    .onNegative(bottomDialog -> cancelEvent())
                    .show();
        } else {
            **mEventDialog.getBuilder().setTitle(address).build();**
            mEventDialog.show();
        }
    }
}
@javiersantos javiersantos self-assigned this Aug 19, 2016
@javiersantos javiersantos changed the title update title or content Crash when showing the same builder two times Aug 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants