Replace isResumed with isRemoving

This commit is contained in:
Alexander Sytnyk 2017-11-07 11:39:14 +02:00
parent 3046db3338
commit e9aef89dee
2 changed files with 3 additions and 3 deletions

View file

@ -817,7 +817,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
if (Build.VERSION.SDK_INT >= 21) {
int colorId = -1;
Fragment fragment = getVisibleFragment(getSupportFragmentManager());
if (fragment != null && fragment.isResumed() && fragment instanceof BaseOsmAndFragment) {
if (fragment != null && !fragment.isRemoving() && fragment instanceof BaseOsmAndFragment) {
colorId = ((BaseOsmAndFragment) fragment).getStatusBarColorId();
} else if (dashboardOnMap.isVisible()) {
colorId = dashboardOnMap.getStatusBarColor();

View file

@ -58,8 +58,8 @@ public class BaseOsmAndFragment extends Fragment {
}
@Override
public void onStop() {
super.onStop();
public void onDetach() {
super.onDetach();
if (Build.VERSION.SDK_INT >= 21 && getStatusBarColorId() != -1) {
Activity activity = getActivity();
if (activity instanceof MapActivity) {