Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2727] GPS app freezes when restarting on Android

GitHub Issuen/a
Resolution Date2012-04-08T07:47:26.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
ReporterSam Huang
AssigneeShak Hossain


When the button is pressed on Android phone, the app will freeze upon running again with the following conditions: - the app make use of the GPS method calls in Ti.Geolocation.* (e.g.: Ti.Geolocation.addEventListener('location', function(e)) - the app removes the location event handler upon Android Activity's "destroy" event, e.g.: Ti.Android.currentActivity.addEventListener('destroy', function(e) { Titanium.Geolocation.removeEventListener('location', locationCallback)... With the above conditions, after the app is successfully launched in Android phone, pressing the button will terminate the app, causing the "destroy" event to fire. In Android's DDMS log it shows: gps_engine_status_update: called release_wakelock_cb - now re-launch the app in Android phone, the app will freeze. To reproduce this behaviour with Kitchen Sink, run KS on actual Android device > "Phone" tab > "Geolocation", after the GPS is active, press button twice to quit app, watch for "gps_engine_status_update" in DDMS log, run KS again.


  1. Sam Huang 2012-04-07

    When the app failed to run again (or hangs), the following are shown in DDMS log: ... ActivityManager Launch timeout has expired, giving up wake lock! ActivityManager Activity idle timeout for HistoryRecord{ ...
  2. Eduardo Gomez 2012-04-07

    @Sam Huang What is the Android OS this was tested on?
  3. Sam Huang 2012-04-07

    OS detail: Device name: Samsung Galaxy S Model number: GT-I9000 Android version: 2.3.7 Kernel Version: CPU: ARMv7 rev 2(v7)
  4. Eduardo Gomez 2012-04-08

    Tested on

    LG Ally Android 2.2 - Not reproduceable in Android PROYO SDK (2.2) This is tied to known issues on Android GINGERBREAD SDK (2.3) http://code.google.com/p/android/issues/detail?id=20707 http://code.google.com/p/android/issues/detail?id=21376
  5. Thomas Amsler 2012-04-14

    I see the same issue on my HTC Nexus One. Android 2.3.7
  6. Thomas Amsler 2012-04-14

    Also, this occurs if you use the Ti.Geolocation.PROVIDER_NETWORK as well as the Ti.Geolocation.PROVIDER_GPS providers.
  7. Sam Huang 2012-04-14

    @Thomas, have you tried the LocaCheck project? See if you can load this app onto your HTC Nexus One and check if it subjects to the same issue with GPS?
  8. Thomas Amsler 2012-04-21

    @Sam where can I find the LocaChek project? Also, the same issue happens when I access the Titanium Kitchen Sink: Phone -> Geolocation To reproduce: 1. Open Phone -> Geolocation 2. Tap back button until app closes 3. Open Phone -> Geolocation 4. Tap back button until app closes 5. Open Phone -> Geolocation At this point the the app won't respond at startup anymore. This also happens not only in 1.8.2 but in 2.0.1.GA2 as well.

JSON Source