my app sends out notification, opens browser given url on tapping. actually, wrapped intent sent broadcastreceiver, , broadcast receiver starts browser.
intent browserintent = new intent(intent.action_view, intent.getdata()); browserintent.addflags(intent.flag_activity_new_task); context.startactivity(showtaskintent);
it works fine notification on pull-down notification bar, not lock screen notification. it's not able open browser on double tapping.
from log, can see activitymanager receives intent, , tries start broswer:
09-02 15:10:52.309 1536-1894/system_process i/activitymanager: start u0 {act=android.intent.action.view dat=https://www.thesun.co.uk/... flg=0x10000000 cmp=com.android.browser/.browseractivity} uid 10059 on display 0
but happened browser is
09-02 15:10:52.910 12131-12131/com.android.browser i/art: starting blocking gc explicit 09-02 15:10:52.978 12131-12131/com.android.browser i/art: explicit concurrent mark sweep gc freed 44(1768b) allocspace objects, 0(0b) los objects, 15% free, 11mb/13mb, paused 427us total 63.223ms 09-02 15:10:52.980 12131-12131/com.android.browser i/art: starting blocking gc explicit 09-02 15:10:53.095 12131-12131/com.android.browser i/art: explicit concurrent mark sweep gc freed 5(160b) allocspace objects, 0(0b) los objects, 15% free, 11mb/13mb, paused 697us total 114.607ms 09-02 15:10:53.095 12131-12131/com.android.browser i/art: starting blocking gc explicit 09-02 15:10:53.255 12131-12131/com.android.browser i/art: explicit concurrent mark sweep gc freed 3(96b) allocspace objects, 0(0b) los objects, 15% free, 11mb/13mb, paused 42.926ms total 145.640ms
my assumption is: @ time, device still locked lock screen, when activitymanager delivers intent start browser, android system might have checks or mechanism not start activity.
has had such problem before? thanks!
i think bug in chrome, , have raised issue both android , chrome:
however, found workaround: use custom tabs instead of normal tabs can solve issue.
intent.putextra("android.support.customtabs.extra.session", context.getpackagename()); intent.putextra("android.support.customtabs.extra.extra_enable_instant_apps", true);
add above extras force chrome use custom tabs.
find more here: https://developer.chrome.com/multidevice/android/customtabs
Comments
Post a Comment