Last active
November 6, 2021 12:39
-
-
Save fmedlin/fcdd9a0c49fd8194fd6c656093c38144 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClickHandler.handleClick(view.findViewById(R.id.about_blog), v -> | |
browseOrToastOnError(view.getContext(), SIMPLENOTE_BLOG_URL)); | |
private void browseOrToastOnError(Context context, String url) { | |
browseOrToastOnError(context, url, R.string.no_browser_available); | |
} | |
private void browseOrToastOnError(Context context, String url, @StringRes int stringRes) { | |
try { | |
BrowserUtils.launchBrowserOrShowError(requireContext(), url); | |
} catch (Exception e) { | |
Toast.makeText(context, stringRes, Toast.LENGTH_LONG).show(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment