New issue
Advanced search Search tips

Issue 697430 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug


Participants' hotlists:
Hotlist-1


Sign in to add a comment

Chrome Custom Tab wont auto close when redirecting back to the same activity that invoked the custom tabs

Reported by vardaan...@gmail.com, Mar 1 2017

Issue description

Steps to reproduce the problem:
1. Made an android app with the following activity manifest:  
         <activity
            android:name="com.a.b.c.abcActivity"
            android:allowTaskReparenting="true"
            android:configChanges="keyboardHidden|orientation|keyboard|screenSize"
            android:launchMode="singleTask"
            android:noHistory="true"
            android:theme="@android:style/Theme.NoTitleBar">
            <intent-filter>
                <data android:scheme="abcd-${applicationId}" />
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
            </intent-filter>
        </activity>
2. From within this same activity invoked a chrome custom tab using:  CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
                         .setShowTitle(true)
                         .setToolbarColor(getTitleBarBackgroundColor())
                         .setStartAnimations(this, android.R.anim.slide_in_left, android.R.anim.slide_out_right)
                         .setExitAnimations(this, android.R.anim.slide_in_left, android.R.anim.slide_out_right)
                         .build();
                 customTabsIntent.intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_SINGLE_TOP);
                 customTabsIntent.launchUrl(this, Uri.parse(url));
3. open a webpage within the custom tab that attempts to redirect back to the same activity that invoked the custom tab

What is the expected behavior?
The chrome custom tab should close

What went wrong?
 when the web page opened within the custom tab attempts to redirect back to app, the redirect succeeds (as logs are produced) but the custom tab does not close and always remains on top unless closed by the user

Did this work before? No 

Chrome version:   Channel: stable
OS Version: 
Flash Version:
 
Components: UI>Browser>Mobile>CustomTabs
Owner: yus...@chromium.org
Status: Assigned (was: Unconfirmed)
 Issue 697427  has been merged into this issue.
In the activity that invokes custom tabs, we had not set any layout as content view. Hence when the custom tab redirected to the activity, since it had nothing to render it went back to the custom tab activity.

Adding a content view to the invoking activity fixed this.

Sign in to add a comment