Я ищу способ, как гласит заголовок, скрыть строку URL.
Я до сих пор получил это, но ничего не изменилось.
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setShowTitle(false);
builder.enableUrlBarHiding();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse(url));
Я пытался использовать веб-просмотры, но у меня были бесконечные проблемы с ними в отношении загрузки файлов и некоторых CSS, которые не работают хорошо.Пользовательская вкладка хорошо работает во всех этих аспектах и выглядит быстрее.
В соответствии с ответом @ 113408 я пытаюсь реализовать TWA, у меня все работает, добавлена ссылка между сайтом иприложение и приложение к веб-сайту, но панель URL все еще жизнеспособна.
Вот файл манифеста, так как это единственная кодировка, которую я сделал.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.comppanynme.twatest">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<meta-data
android:name="asset_statements"
android:resource="@string/asset_statements" />
<activity
android:name="android.support.customtabs.trusted.LauncherActivity">
<!-- Edit android:value to change the url opened by the TWA -->
<meta-data
android:name="android.support.customtabs.trusted.DEFAULT_URL"
android:value="http://192.168.8.46" />
<!-- This intent-filter adds the TWA to the Android Launcher -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!--
This intent-filter allows the TWA to handle Intents to open
airhorner.com.
-->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<!-- Edit android:host to handle links to the target URL-->
<data
android:scheme="http"
android:host="192.168.8.46"/>
</intent-filter>
</activity>
</application>
</manifest>
Вот мое заявление об активе
<string name="asset_statements">
[{
\"relation\": [\"delegate_permission/common.handle_all_urls\"],
\"target\": {
\"namespace\": \"web\",
\"site\": \"http://192.168.8.46"}
}]
</string>