Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26161] Android: Activity Listening Broken on run-on-main-thread = true

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-08-24T01:27:17.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsAndroid
Labelsactivity, alloy, android, listener, reset
Reporterjosh.mocek
AssigneeGary Mathews
Created2018-06-26T20:26:14.000+0000
Updated2019-02-12T19:01:29.000+0000

Description

Tested with a Pixel on Android 8.0 using a wireless keyboard. Build the app and you will see the OS logs appear. When a wireless keyboard is connected to the device via bluetooth it causes the app to soft reset on Android. I used
Ti.App._restart();
because I've had problems with the soft reset holding things in memory. When
<property name="run-on-main-thread" type="bool">false</property>
the listener works correctly. The app restarts and runs 'Start by OS' and 'Resume by OS'. When
<property name="run-on-main-thread" type="bool">true</property>
the listener does not fire the 'START' & 'RESUME' activity listener after the reset. You will notice this by the lack of error logs.

Attachments

FileDateSize
index.js2018-06-26T20:25:17.000+00001840
index.xml2018-06-26T20:25:14.000+0000180
tiapp.xml2018-06-26T20:25:09.000+00003624

Comments

  1. Hans Knöchel 2018-06-27

    [~josh.mocek] Is this Android 8 only? And which Ti-SDK version are you using?
  2. josh.mocek 2018-06-27

    Hans Knochel I can test on a different android version, and SDK is on 7.1.1
  3. josh.mocek 2018-06-27

    Hans Knochel same bad results on Android 7.1.1 & SDK 7.1.1 Android 7.1.1 & SDK 7.2.0 Android 7.1.1 & SDK 7.0.2
  4. Gary Mathews 2018-06-27

    master: https://github.com/appcelerator/titanium_mobile/pull/10137
  5. Josh Longton 2018-08-14

    *Closing ticket.* Activity callbacks are now being called when running on main thread. The fix is present in SDK: {noformat} 7.4.0.v20180810061237 {noformat} *ENV* {noformat} Appc NPM: 4.2.13 Appc CLI: 7.0.4 Ti CLI: 5.1.1 Node: 10.3.0 NPM: 6.3.0 {noformat}
  6. josh.mocek 2019-02-12

    It is now firing the start and resume events, but not the destroy event like when run on main thread is false

JSON Source