protect first app start

This commit is contained in:
afischerdev 2024-09-02 14:46:12 +02:00
parent 6ae9a0a65f
commit d347fecdd2
2 changed files with 4 additions and 3 deletions

View File

@ -487,12 +487,12 @@ public class BRouterActivity extends AppCompatActivity implements ActivityCompat
return checked;
}
public void selectProfile(String[] items) {
public void selectProfile(String[] items, boolean showDialog) {
availableProfiles = items;
Arrays.sort(availableProfiles);
// show main dialog
showADialog(DIALOG_MAINACTION_ID);
if (showDialog) showADialog(DIALOG_MAINACTION_ID);
}
public void startDownloadManager() {

View File

@ -250,11 +250,12 @@ public class BRouterView extends View {
};
if (!RoutingHelper.hasDirectoryAnyDatafiles(segmentDir)) {
((BRouterActivity) getContext()).selectProfile(profiles.toArray(new String[0]), false);
((BRouterActivity) getContext()).startDownloadManager();
waitingForSelection = true;
return;
}
((BRouterActivity) getContext()).selectProfile(profiles.toArray(new String[0]));
((BRouterActivity) getContext()).selectProfile(profiles.toArray(new String[0]), true);
} catch (Exception e) {
String msg = e instanceof IllegalArgumentException ? e.getMessage()
+ (cor == null ? "" : " (coordinate-source: " + cor.basedir + cor.rootdir + ")") : e.toString();