Closed droididan closed 8 years ago
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(); } } }
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."