Fix ClassCastException

This commit is contained in:
Alexey Kulish 2018-10-17 19:16:01 +03:00
parent bc764165b8
commit 50643f3f85

View file

@ -2373,14 +2373,15 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (getParentFragment() instanceof QuickSearchDialogFragment) {
QuickSearchDialogFragment parentFragment = (QuickSearchDialogFragment) getParentFragment();
SearchHistoryHelper helper = SearchHistoryHelper.getInstance(parentFragment.getMyApplication());
Fragment parentFragment = getParentFragment();
if (parentFragment instanceof QuickSearchDialogFragment) {
QuickSearchDialogFragment searchDialogFragment = (QuickSearchDialogFragment) parentFragment;
SearchHistoryHelper helper = SearchHistoryHelper.getInstance(searchDialogFragment.getMyApplication());
for (QuickSearchListItem searchListItem : selectedItems) {
helper.remove(searchListItem.getSearchResult().object);
}
parentFragment.reloadHistory();
parentFragment.enableSelectionMode(false, -1);
searchDialogFragment.reloadHistory();
searchDialogFragment.enableSelectionMode(false, -1);
}
}
})