Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17198] Android: Closing Titanium app on Android 4.4.3 will show previous app

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionNot Our Bug
Resolution Date2014-07-09T05:50:25.000+0000
Affected Version/sRelease 3.2.3, Release 3.3.0
Fix Version/sn/a
ComponentsAndroid
Labels3.3.0.RC, Android
ReporterMichael Gangolf
AssigneePing Wang
Created2014-06-20T21:35:37.000+0000
Updated2017-03-14T05:01:45.000+0000

Description

Problem Description

Closing a titanium app on Android 4.4.3 will lead to the previous app from the task switcher showing up for a short time.

Steps to reproduce

1. Create new app (classic titanium) 2. Using Mobile SDK 3.3.0.RC 3. Use the default project (two tabs) 4. Install it on a device with 4.4.3 5. Do this: * home screen * opening camera app * closing camera app * home screen * opening titanium app * closing titanium app * camera app shows up shortly * home screen

Extra information

QA Link: http://developer.appcelerator.com/question/175386/android-443-closing-ti-app-will-show-previous-app

Comments

  1. Mauro Parra-Miranda 2014-06-23

    Hello Michael, does this happen with the default app? We need instructions to reproduce this, I don't have a device to try this, so we need you to follow this instructions: 1. Open Ti Studio 2. Create a new mobile project (classic) 3. Select the classic two tabs. 4. Run this into your device. Does this reproduce the issue? Best, Mauro
  2. Manuel Lehner 2014-06-23

    Hello Mauro, I have tested this too on different devices and can confirm the behaviour. I've build the the test app with SDK 3.2.3.GA and installed on my Nexus 5 with Android 4.4.3 and other devices with older Versions - everything was fine. Then I've build the app with 3.3.0.Beta and 3.3.0.RC and the described behaviour appeared on Android 4.4.3 but not on 4.4.2 or 4.3 - Same for every other Titanium App I've tested.
  3. Michael Gangolf 2014-06-24

    I even have problems with my own apps I've installed from the store (build before 4.4.3) or had on the device before I did the update! Only Titanium apps showed this behaviour in 4.4.3 and still do in 4.4.4 (update arrived yesterday) Default app does the same when closing it (3.2.3 GA, 3.3.0 RC) Log:
       06-24 10:37:18.171: I/ActivityManager(587): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.user.testtab/.TesttabActivity} from pid 1225
       06-24 10:37:18.271: D/dalvikvm(587): GC_FOR_ALLOC freed 626K, 17% free 23092K/27812K, paused 101ms, total 101ms
       06-24 10:37:18.311: I/TiRootActivity(15625): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
       06-24 10:37:18.341: D/dalvikvm(15625): GC_CONCURRENT freed 823K, 27% free 9599K/13064K, paused 3ms+1ms, total 23ms
       06-24 10:37:18.441: D/dalvikvm(587): GC_FOR_ALLOC freed 47K, 16% free 23450K/27812K, paused 85ms, total 85ms
       06-24 10:37:18.451: I/dalvikvm-heap(587): Grow heap (frag case) to 25.549MB for 2731536-byte allocation
       06-24 10:37:18.481: W/V8Object(15625): Runtime disposed, cannot set property 'userAgent'
       06-24 10:37:18.481: W/TiApplication(15625): (KrollRuntimeThread) [170,170] Registering module with name already in use.
       06-24 10:37:18.561: D/dalvikvm(587): GC_FOR_ALLOC freed <1K, 15% free 26118K/30480K, paused 116ms, total 116ms
       06-24 10:37:18.671: I/ActivityManager(587): START u0 {cmp=com.user.testtab/org.appcelerator.titanium.TiActivity (has extras)} from pid 15625
       06-24 10:37:18.782: D/dalvikvm(15625): GC_FOR_ALLOC freed 74K, 27% free 9645K/13064K, paused 17ms, total 17ms
       06-24 10:37:18.792: I/dalvikvm-heap(15625): Grow heap (frag case) to 12.054MB for 2731536-byte allocation
       06-24 10:37:18.812: D/dalvikvm(15625): GC_FOR_ALLOC freed 3K, 6% free 12309K/13064K, paused 19ms, total 19ms
       06-24 10:37:18.832: D/dalvikvm(15625): GC_CONCURRENT freed 2K, 6% free 12306K/13064K, paused 2ms+2ms, total 19ms
       06-24 10:37:18.832: I/TiRootActivity(15625): (main) [0,0] checkpoint, on root activity resume. activity = com.user.testtab.TesttabActivity@42591d78
       06-24 10:37:19.102: I/ActivityManager(587): Displayed com.user.testtab/org.appcelerator.titanium.TiActivity: +180ms (total +796ms)
       06-24 10:37:22.085: D/dalvikvm(1055): GC_CONCURRENT freed 3179K, 47% free 12351K/22916K, paused 8ms+13ms, total 97ms
       
       ----running, now closing ----
       
       06-24 10:37:24.718: D/TabGroup(15625): Tabgroup is closed normally.
       06-24 10:37:24.818: D/dalvikvm(587): GC_FOR_ALLOC freed 434K, 16% free 25772K/30480K, paused 85ms, total 85ms
       
       
  4. Michael Gangolf 2014-06-24

    I'm at Ticonf Amsterdam and got my device with me if you need to do some testing
  5. Lokesh Choudhary 2014-06-24

    Verified the issue is reproducible. This issue is seen even if the first app opened is a titanium app & not just camera or default android apps.

    Below are my findings:

    1. Open any app, even titanium app.(this is first app) 2. Press home button. (app is backgrounded) 3. Open a titanium app.(this is second app) 4. Close it by tapping the back button. 5. You will see the previous app for 1 sec.

    Special case when chrome browser is the first app:

    6. Open Chrome browser on nexus 5.(This is the first app) 7. Close it using the back button. (this step is the difference as compared to above) 8. Open a titanium app.(this is second app) 9. Close it by tapping the back button. 10. You will see the chrome browser for 1 sec. Environment: Appc Studio : 3.3.0.201406231625 Ti SDK : 3.3.0.v20140624130120 Mac OSX : 10.8.5 Alloy : 1.4.0-rc2 CLI - 3.3.0-rc2 Code Processor: 1.1.1 Nexus 5 - android 4.4.4
  6. Ingo Muschenetz 2014-06-24

    I think this may be a native problem. See comment on: http://androidspin.com/2014/06/15/discussion-problems-android-4-4-3-deep-rabbit-hold-go/ "gogoboy • 8 days ago Since updated to 4.4.3, power juice seems shorter. Same usage, but my Nexus4 keeps screaming time to recharge. I recall that 4.4.2 would last me till the end plus avg 20+% remain. Another problem makes my eyes sore is, when close one app, the previous app will show about a couple seconds." 4.4.4 is supposed to fix 4.4.3 issues: http://www.neowin.net/news/google-rolls-out-android-444-after-buggy-bug-fixing-443-release
  7. Ingo Muschenetz 2014-06-24

    Can we take a quick look and see if anything looks suspicious here from the Titanium perspective?
  8. Michael Gangolf 2014-06-24

    @Ingo Muschenetz: the problem still occurs in 4.4.4 on my Nexus 4. Perhaps the app gogoboy is talking about is a Titanium app.
  9. Ingo Muschenetz 2014-06-24

    That's possible. [~lchoudhary] Are you able to reproduce it if neither application is a Titanium application?
  10. Lokesh Choudhary 2014-06-24

    [~ingo]- I don't see the issue if neither of the applications are titanium applications. FYI, I am using 4.4.4 Nexus 5 device for testing.
  11. Ping Wang 2014-06-27

    Technically speaking, this is not a regression. This issue happens when the exitOnClose property of the first/root window is set to true. Since in 3.3, exitOnClose is set to true by default (see [this commit](https://github.com/appcelerator/titanium_mobile/commit/b82829e6f1471490a2866538cabffd13df80a3dc)), this issue shows even exitOnClose is not explicitly specified. A simple test case:
        var win1 = Titanium.UI.createWindow({
            backgroundColor : '#fff',
            exitOnClose: true
        });
        win1.open();
        
  12. Manuel Lehner 2014-06-29

    I've seen this issue occur on other Apps too (e.g. Dropbox) which are not build with Titanium. Problem still occurs on Android L btw.
  13. Lokesh Choudhary 2014-07-01

    Tried to reproduce this with non titanium apps on Nexus 5 - android 4.4.4 Tried with dropbox app as mentioned in the comment above, but could not reproduce the issue with non titanium apps.
  14. Manuel Lehner 2014-07-08

    Here is a simple workaround until this is fixed:
        var win1 = Titanium.UI.createWindow({
            backgroundColor : '#fff',
            exitOnClose: false
        });
        win1.addEventListener("androidback", function(){
            win1.getActivity().finish();
        });
        win1.open();
        
  15. Ping Wang 2014-07-09

    This is an Android issue on 4.4.3 and above, which has been filed [Issue 71067](https://code.google.com/p/android/issues/detail?id=71067). Seems Google has fixed it. Hopefully the fix will be in the next 4.4.x patch.
  16. Lee Morris 2017-03-14

    Closing ticket as the issue is not our bug.

JSON Source