Skip to content

Commit

Permalink
Fix possible AndroidRuntimeException
Browse files Browse the repository at this point in the history
  • Loading branch information
Chumva committed Sep 23, 2024
1 parent f01edd8 commit f2e83fe
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,12 @@ private void buildItem(@NonNull ViewGroup container, @NonNull String title, @Non
return true;
});
if (isUrl) {
view.setOnClickListener(v -> AndroidUtils.openUrl(app, description, nightMode));
view.setOnClickListener(v -> {
FragmentActivity activity = getActivity();
if (activity != null) {
AndroidUtils.openUrl(activity, description, nightMode);
}
});
}

container.addView(view);
Expand Down

0 comments on commit f2e83fe

Please sign in to comment.