Fix #2886
This commit is contained in:
parent
93f05e4363
commit
619985962f
2 changed files with 16 additions and 2 deletions
|
@ -12,8 +12,7 @@ public class DestinationReachedMenu extends BaseMenuController {
|
|||
}
|
||||
|
||||
public static void show(MapActivity mapActivity) {
|
||||
Fragment fragment = mapActivity.getSupportFragmentManager().findFragmentByTag(DestinationReachedMenuFragment.TAG);
|
||||
if (fragment == null || fragment.isDetached()) {
|
||||
if (!DestinationReachedMenuFragment.isExists()) {
|
||||
DestinationReachedMenu menu = new DestinationReachedMenu(mapActivity);
|
||||
DestinationReachedMenuFragment.showInstance(menu);
|
||||
}
|
||||
|
|
|
@ -27,8 +27,14 @@ import net.osmand.plus.poi.PoiUIFilter;
|
|||
|
||||
public class DestinationReachedMenuFragment extends Fragment {
|
||||
public static final String TAG = "DestinationReachedMenuFragment";
|
||||
private static boolean exists = false;
|
||||
private DestinationReachedMenu menu;
|
||||
|
||||
|
||||
public DestinationReachedMenuFragment() {
|
||||
exists = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -153,6 +159,15 @@ public class DestinationReachedMenuFragment extends Fragment {
|
|||
getMapActivity().getContextMenu().setBaseFragmentVisibility(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
exists = false;
|
||||
}
|
||||
|
||||
public static boolean isExists() {
|
||||
return exists;
|
||||
}
|
||||
|
||||
public static void showInstance(DestinationReachedMenu menu) {
|
||||
int slideInAnim = menu.getSlideInAnimation();
|
||||
|
|
Loading…
Reference in a new issue