Skip to content

Commit

Permalink
Handle ActivityNotFoundException and SecurityException in StorageMigr…
Browse files Browse the repository at this point in the history
…ationDialog
  • Loading branch information
grzesiek2010 authored and lognaturel committed Apr 9, 2020
1 parent 054697a commit 7ce5fd9
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.odk.collect.android.storage.migration;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
Expand All @@ -14,11 +15,13 @@

import org.jetbrains.annotations.NotNull;
import org.odk.collect.android.R;
import org.odk.collect.android.activities.WebViewActivity;
import org.odk.collect.android.application.Collect;
import org.odk.collect.android.fragments.dialogs.AdminPasswordDialog;
import org.odk.collect.android.injection.DaggerUtils;
import org.odk.collect.android.material.MaterialFullScreenDialogFragment;
import org.odk.collect.android.utilities.AdminPasswordProvider;
import org.odk.collect.android.utilities.CustomTabHelper;
import org.odk.collect.android.utilities.DialogUtils;

import javax.inject.Inject;
Expand Down Expand Up @@ -139,7 +142,13 @@ private void setUpMessageAboutUnsetSubmissions() {
private void showMoreDetails() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://forum.opendatakit.org/t/25268"));
startActivity(intent);
try {
startActivity(intent);
} catch (ActivityNotFoundException | SecurityException e) {
intent = new Intent(getContext(), WebViewActivity.class);
intent.putExtra(CustomTabHelper.OPEN_URL, "https://forum.opendatakit.org/t/25268");
startActivity(intent);
}
}

private void disableDialog() {
Expand Down

0 comments on commit 7ce5fd9

Please sign in to comment.