question

Makoto Hasegawa avatar image
Makoto Hasegawa asked

onNewIntent working on Fire HD 10 but Fire HD 8 doesn't work

Hello. I made GoogleSignin system.
GoogleSignin on Browser then callback to onNewIntent.
I can get authorization code from intent.
FIre HD 10 is working fine, but Fire HD 8 doesn't call onNewIntent.
Both device same OS version 7.3.2.3.Browser is Silk.

I feel weird some part of log. Please check below.

This is Fire HD 8, doesn't call onNewIntent, call onRestart.
(1) I/ActivityManager: START u0 {act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] (has data) flg=0x10000000 cmp=xx.xx.xxxx/.Login (has clip)} from uid 10063
(2) onRestart
(3) I/PackageRecency: Queuing notification(s) to package for ActivityInfo{3391b7f xx.xx.xxxx.Login}

This is Fire HD 10, it's fine.

(1) I/ActivityManager: START u0 {act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] (has data) flg=0x10000000 cmp=xx.xx.xxxx/.Login (has clip)} from uid 10110
(2) I/PackageRecency: Queuing notification(s) to package for ActivityInfo{59474f3 xx.xx.xxxx.Login}
(3) D/ForegroundAppTracker: Inside onActivityResume. Component name : ComponentInfo{xx.xx.xxxx/xx.xx.xxxx.Login}
(4) onNewIntent
I think start activity have to after (2) or (3) but Firer HD 8 is after (1) running.
Do you know reason why?

fire tablet
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi Makoto,

Thanks for posting! I'm glad you have resolved this issue already, and shared the solution with other developers! Thank you!

0 Likes 0 ·

1 Answer

Makoto Hasegawa avatar image
Makoto Hasegawa answered

I found another solution.
I don't use onNewIntent. Make new activity, for example GetCodeActivity.
AndroidManifest setting for Browser redirect to launch GetCodeActivity.
When launch GetCodeActivity i can get authorization code.
This is working on FireHD8 and FireHD10.

protected void onStart() { // or onCreate
   Intent intent = getIntent(); <- intent result same onNewIntent argument.
   String AuthorizationCode = intent.getData().getQueryParameter("code");
}
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.