我想问一下,有没有办法让环球航空(Trusted Web Authority)应用程序在新的浏览器窗口中打开外部链接,这些链接的主机与AndroidManifest.xml中定义的不同,而不是应用程序的webview?
我的AndroidManiest.xml是这样的:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.placeholder">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="${launcherName}"
android:supportsRtl="true"
android:theme="@style/Theme.TwaSplash">
<meta-data
android:name="asset_statements"
android:value="${assetStatements}" />
<activity android:name="android.support.customtabs.trusted.LauncherActivity"
android:label="${launcherName}">
<meta-data android:name="android.support.customtabs.trusted.DEFAULT_URL"
android:value="${defaultUrl}" />
<meta-data
android:name="android.support.customtabs.trusted.STATUS_BAR_COLOR"
android:resource="@color/colorPrimary" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"
android:host="${hostName}"/>
</intent-filter>
</activity>
</application>
</manifest>谢谢
发布于 2021-02-23 16:26:43
目前还不能控制如何从Android应用程序打开链接。
但是,当在受信任的网络活动中打开外部链接时,它将使用Custom Tabs而不是WebView。这意味着使用用户的底层浏览器,它具有相同的web平台功能,并与独立浏览器共享存储(例如: cookies)。
https://stackoverflow.com/questions/61443419
复制相似问题