15

I have implemented new Chrome Custom Tab in android, I am using the following code to open

    String url = "http://www.flipkart.com/";
    int color = Color.BLUE;
    CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();
    intentBuilder.setToolbarColor(color);
    intentBuilder.setShowTitle(true); 
    CustomTabActivityHelper.openCustomTab(
            this, intentBuilder.build(), Uri.parse(url), new  WebviewFallback());

I need to secure my URL or not like to show my URL to User, But there is a option Open in Chrome in default menu, By using this link user can open my URL in browser,By how hide the default menu?

my output

appukrb
  • 1,507
  • 4
  • 24
  • 53
  • Chrome Custom Tabs should be used when you want to open a 3rd party Url or a 1st party one that is also available on the Web. If you are opening content that is exclusive to the app and therefore want a hidden Url, you may want to use the WebView or consider using a native UI. – andreban Sep 08 '15 at 07:59
  • Just out of curiosity. How exactly are you running this? On a phone with 6.0 Developer Preview? – Suleiman19 Oct 04 '15 at 16:50
  • @Suleiman19 For this we need to update Google chrome in your device, No need of 6.0,refer this https://developer.chrome.com/multidevice/android/customtabs – appukrb Oct 06 '15 at 04:14

5 Answers5

2

At this moment, it's not possible to hide the overflow menu or "Open in Chrome" menu item.

andreban
  • 4,621
  • 1
  • 20
  • 49
  • Are you sure? Twitter have customized the menu by removing the default icons row. This means that there is a way to play with the menu items, if it's not possible to hide the whole menu. – moud Nov 19 '15 at 11:23
  • Is it still the same ?, i.e we cannot hide overflow menu and URL bar in custom chrome tab. – SimpleCoder Nov 05 '18 at 03:22
0

There are no methods for hiding the menu option in Chrome custom tabs

0

Chrome Custom Tab actually uses Chrome app in user's mobile.

start activity in Chrome app by link, If chrome not installed on the user's mobile, it will use a webView as the default.

In fact, Chrome Custom Tabs is designed to display a web page where the user is sure that the programmer of that software does not have a phishing, Like a bank payment.

Therefore, you must show the options in the toolbar to the user.

Rasoul Miri
  • 11,234
  • 1
  • 68
  • 78
0

This can be hide by using app link assistant.

complete guideline for how to create app link can be found here. https://developer.android.com/studio/write/app-link-indexing

after successful generation and verification the above header can be hidden.

I have implemented this and result is like enter image description here

Nawin
  • 485
  • 8
  • 14
-6

You must add hiding flag before. To disable your URL parameter but it can't hide your site name.

intentBuilder.enableUrlBarHiding();