0
它仍在我的应用程序中运行。有人能帮我吗 ?我如何从我的应用程序中打开外部URL?如何从我的应用程序打开外部URL?
public static void openUrl(final Activity context, final String url) {
\t \t \t openUrl(context, url, false);
\t \t }
\t
\t \t public static void openUrl(final Activity context, final String url, final boolean withoutTransition) {
\t \t \t final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
\t \t \t intent.setPackage(getAlternative(context));
\t \t \t intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
\t \t \t context.startActivity(intent);
\t \t \t if (withoutTransition) {
\t \t \t \t context.overridePendingTransition(0, 0);
\t \t \t }
\t \t }
你考虑,这可能是一个共同的问题,一个试着问前搜索网站? https://stackoverflow.com/questions/2201917/how-can-i-open-a-url-in-androids-web-browser-from-my-application – Toastrackenigma
可能的重复[如何在Android中打开URL从我的应用程序的Web浏览器?](https://stackoverflow.com/questions/2201917/how-can-i-open-a-url-in-androids-web-browser-from-my-application) – Toastrackenigma