From 97818c644c9acff237c5061ccf334f40bfb8e8de Mon Sep 17 00:00:00 2001 From: Hristo Hristov Date: Fri, 24 Jun 2016 17:56:29 +0300 Subject: [PATCH] Activity intent extras are set on application run which breaks Frame class logic. They were never set on lower API levels (#2367) --- apps/css-perf-test/package.json | 2 ++ tns-core-modules/ui/frame/frame.android.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 apps/css-perf-test/package.json diff --git a/apps/css-perf-test/package.json b/apps/css-perf-test/package.json new file mode 100644 index 000000000..8147e277c --- /dev/null +++ b/apps/css-perf-test/package.json @@ -0,0 +1,2 @@ +{ "name" : "css-perf-test", + "main" : "app.js" } diff --git a/tns-core-modules/ui/frame/frame.android.ts b/tns-core-modules/ui/frame/frame.android.ts index 7f209009b..9dcd29241 100644 --- a/tns-core-modules/ui/frame/frame.android.ts +++ b/tns-core-modules/ui/frame/frame.android.ts @@ -773,10 +773,13 @@ class ActivityCallbacksImplementation implements definition.AndroidActivityCallb // We have extras when we call - new Frame().navigate(); // savedInstanceState is used when activity is recreated. + // NOTE: On API 23+ we get extras on first run. + // Check changed - first try to get frameId from Extras if not from saveInstanceState. if (extras) { frameId = extras.getInt(INTENT_EXTRA, -1); } - else if (savedInstanceState) { + + if (savedInstanceState && frameId < 0) { frameId = savedInstanceState.getInt(INTENT_EXTRA, -1) }