Fix first usage wizard

This commit is contained in:
Alexey Kulish 2016-11-19 16:55:48 +03:00
parent 8b39eebb77
commit efeb40bad8

View file

@ -692,6 +692,7 @@ public class FirstUsageWizardFragment extends Fragment implements OsmAndLocation
}
public static void startWizard(FragmentActivity activity) {
if (activity != null) {
OsmandApplication app = (OsmandApplication) activity.getApplication();
if (!app.getSettings().isInternetConnectionAvailable()) {
showNoInternetFragment(activity);
@ -701,6 +702,7 @@ public class FirstUsageWizardFragment extends Fragment implements OsmAndLocation
showSearchMapFragment(activity);
}
}
}
public void closeWizard() {
FragmentActivity activity = getActivity();
@ -730,6 +732,7 @@ public class FirstUsageWizardFragment extends Fragment implements OsmAndLocation
}
private static void findLocation(FragmentActivity activity, boolean searchLocationByIp) {
if (activity != null) {
OsmandApplication app = (OsmandApplication) activity.getApplication();
if (searchLocationByIp) {
showSearchLocationFragment(activity, true);
@ -745,6 +748,7 @@ public class FirstUsageWizardFragment extends Fragment implements OsmAndLocation
showSearchLocationFragment(activity, false);
}
}
}
public void updateStorageView() {
updateStorageView(view.findViewById(R.id.storage_layout));
@ -870,7 +874,7 @@ public class FirstUsageWizardFragment extends Fragment implements OsmAndLocation
}
private static void showFragment(FragmentActivity activity, Fragment fragment) {
if (!wizardClosed) {
if (!wizardClosed && activity != null) {
activity.getSupportFragmentManager()
.beginTransaction()
.replace(R.id.fragmentContainer, fragment, FirstUsageWizardFragment.TAG)