Skip to content
Snippets Groups Projects
Commit 1618c890 authored by Hans-Christoph Steiner's avatar Hans-Christoph Steiner
Browse files

Merge branch 'anti-feature-link-crash' into 'master'

Don't crash when user clicks Anti-feature link without browser

Closes acra-crash-reports#826

See merge request !1542
parents 7741ac9b e7fe0796
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@
package org.fdroid.fdroid.views.appdetails;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
......@@ -28,6 +29,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
......@@ -106,7 +108,13 @@ public class AntiFeaturesListingView extends RecyclerView {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
i.setData(Uri.parse("https://f-droid.org/docs/Anti-Features#" + antiFeatureId));
try {
getContext().startActivity(i);
} catch (ActivityNotFoundException ex) {
Toast.makeText(getContext(),
getContext().getString(R.string.no_handler_app, antiFeatureId),
Toast.LENGTH_LONG).show();
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment