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