かなりシンプルです。あなたはGergelyと同様にコメントでChrome Custom Tabsを使う必要があります。以下は、これを達成するのに役立つ小さな機能コードです。
まずあなたのbuild.gradleにこの依存関係を追加します(モジュール:アプリ)
compile 'com.android.support:customtabs:23.4.0'
第二には、あなたのコードに機能の下に追加して、単にそれに文字列のURLを渡します。
private void redirectUsingCustomTab(String url)
{
Uri uri = Uri.parse(url);
CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();
// set desired toolbar colors
intentBuilder.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary));
intentBuilder.setSecondaryToolbarColor(ContextCompat.getColor(this, R.color.colorPrimaryDark));
// add start and exit animations if you want(optional)
/*intentBuilder.setStartAnimations(this, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
intentBuilder.setExitAnimations(this, android.R.anim.slide_in_left,
android.R.anim.slide_out_right);*/
CustomTabsIntent customTabsIntent = intentBuilder.build();
customTabsIntent.launchUrl(activity, uri);
}
休憩それ自体は気を付けます。 Chromeのカスタムタブはカスタマイズできるので、ツールバーにメニューを追加できるようにたくさんのことができます。詳細については、Google自身の公式ドキュメントhereをご覧ください。
は、それはあなたがあなたが[クロームカスタムタブ](https://developer.chrome.com/multidevice/android/customtabs)が必要です:)
で始めるのに役立ちます願っています。 –
こんにちは@GergelyKőrössy、助けてくれてありがとう..私はそれを試してみましょう。 – Dika
@Dika –