android - How to tell when user selects "Open in Chrome" from menu -


i'm trying determine when user opens chrome custom tab in chrome (the "open in chrome" option menu).

my navigation callback returns event code of 6, same code returned when user closes custom tab. there way differentiate between whether user has closed custom tab or opened in chrome?

navigation code 6 means customtabs activity not visible more either user has navigated activity started customtabs intent or activity, in case chrome has been started, has taken place.

when user navigates customtabs activity chrome navigation code 6, when button hit, event sent code 5 (tab visible again). in case customactivity still visible, previous activity finished, activity started intent still paused.

starting customtabs activity might solve case when have navigation code 6 , onactivityresult() method called on activity started session.

public void openurlforresult(string url, int requestcode){     customtabsintent customtabsintent = buildcustomtabintent(mcustomtabsession);     customtabsintent.intent.setdata(uri.parse(url));     mcontext.startactivityforresult(customtabsintent.intent, requestcode); } 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -