[TIMOB-24253] Android: androidback event not working in Ti SDK 6.0.0.GA
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-01-28T00:41:06.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 6.0.2 |
Components | Android |
Labels | Android, backbutton |
Reporter | Ricardo Ramirez |
Assignee | Gary Mathews |
Created | 2016-12-21T15:40:33.000+0000 |
Updated | 2017-03-08T03:54:32.000+0000 |
Description
Issue Description
Hi,
To prevent window close on android hardware back click, customer have been using "andoridback" event.
This was working properly till 5.5.1.GA. With 6.0.0.GA, even though this event is fired, it is not preventing the window close.
Steps to Replicate
Download the attached project
Make sure is running SDK 6.0.0GA (works on 5.5.1.GA)
Run
Click on Hello World to open a new screen
Click the back button
If the project is built with 5.5.1.GA, new screen will not close on hardware back click. But the new screen will close if the project is built with 6.0.0.GA.
Attachments
master: https://github.com/appcelerator/titanium_mobile/pull/8715
Verified fixed, screen does not close when the back button is pressed when using androidback event. *Environement*
Using a camera with an overlay I'll get the following error in 6.1.0:
Test app:
When the camera view is open press back Device: HTC A9 Ti 6.0.1.GA is working fine
PR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8775
Reopening for the patch-PR provided by [~michael], thank you! PR (master): https://github.com/appcelerator/titanium_mobile/pull/8779 PR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8780
[~hansknoechel], I see the fix in SDK 6.0.2.v20170123140026 & 6.1.0.v20170123141052 but, I can still reproduce the camera issue. Appc Studio : 4.8.1.201612050850 Mac OS Version : 10.12.2 Xcode Version : Xcode 8.2.1 Build version 8C1002 Appc CLI AND Appc NPM : {"NPM":"4.2.9-1","CLI":"6.1.0"} Ti CLI : 5.0.11 Alloy : 1.9.5 Node : v4.6.0
@lchoudhary are you sure that my fix was included in that version? Looking at travis it says the version should be 6.0.2.v20170123204635
[~michael], [~hansknoechel], I see this code for the fix on line no 859 of the TiBaseActivity.class file in both the SDK's:
Anyhow I will check it again with the latest build. *UPDATE:* Travis says the build 6.0.2.v20170123204635 has been built but I do not see it on the builds page nor I can get it the CLI. I checked with latest master 6.1.0.v20170124071525 & my app still crashes with error:
*EDIT* : Ignore my above comment about failing with latest master as travis says the build has failed: https://travis-ci.org/appcelerator/titanium_mobile/builds/194570882
That's correct. But I think the build you've tested was built before it was included. Or did you create an own version from source?
Tuesday 24th January 2017 Environment: Appcelerator Command-Line Interface, version 6.1.0 Android 7.1 (Google Pixel) Operating System Name: MacOS Sierra Operating System Version: 10.12.1 Node.js Version: 4.5.0 NPM: 4.2.8 Appc NPM: 4.2.8 Titanium SDK Version: 6.0.2.v20170123062940 Xcode: 8.2.1 Studio Build: 4.8.1.201612050850 Step 1) Download the provided application (TestAndroidBack) Step 2) Update Guid and set SDK to 6.0.2 Step 3) Run Application and press "hello world" Step 4) After being taken to the next screen with a yellow background, I pressed the hardware back button. Step 5) Observations that the application stayed on that page and the app stayed open This Verified that the ticket is still fixed! Step 7) Run the same application after switching SDK to 6.0.0.GA to verify i can reproduce the error before confirming that the ticket is indeed closed . Step 8) After testing the application in the above the SDK the application and can confirm that when clicking the back button once progressing to the yellow screen, the application fails to stay on that page and does go back, meaning I have recreated the issue From the above steps i can confirm this ticket is closed for 6.0.2.
However after looking at the camera issue above, the application crashes SDK: 6.0.2.v20170123140026 app.js:
as a result i will reopen the Ticket
To sum up: 1. Build 6.0.2.v20170124145857 is failing with the same original logs as Michael G even though I can see the fix in it.
2. Master 6.1.0.v20170124145731 fails due to other reason probably due to TIMOB-20459 with logs:
Verified the fix is present in SDK 6.1.0.v20170126102557. Waiting for the fix for 6.0.2 branch.
master: https://github.com/appcelerator/titanium_mobile/pull/8796 6_0_X: https://github.com/appcelerator/titanium_mobile/pull/8797 [~michael] The 6_0_X fix https://github.com/appcelerator/titanium_mobile/pull/8780/files has a mistake and should have been
==
, I've amended that in my 6_0_X PR. Which is why the bug was still reproducible on6.0.2
. Fix for:[~gmathews] Thanks for the fix! I shouldn't use the edit function on github and create patches there, stupid typo!
Verified the fix is present in SDK 6.0.2.v20170130045621. Closing.
Need to make-up your mind as to whether overriding the back button needs to happen via androidback or http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Window-property-onBack. This request reverts to old behaviour!