Fix first usage wizard

This commit is contained in:
Alexey Kulish 2016-11-19 16:55:48 +03:00
parent b33eac33fe
commit c4f9819353

View file

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