Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3245] Android: getInstanceCount() (code in TiLauncherActivity) no longer exists in api 11 and app crashes if it's called

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:01:16.000+0000
Affected Version/sn/a
Fix Version/sSprint-2011-09
ComponentsAndroid
Labelsandroid, defect, honeycomb, release-1.7.0, reported-1.6.0
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:40:19.000+0000
Updated2011-04-17T02:01:16.000+0000

Description

The relevant code in Titanium is only hit if you start an app from a download such as from the Android Market. And it's only in a Log statement. I noticed it was removed from Android because I looked at this:

http://developer.android.com/sdk/api_diff/11/changes/android.app.Activity.html#android.app.Activity.getInstanceCount_removed()"> http://developer.android.com/sdk/api_diff/11/changes/android.app.Ac...

To test what happens when it's called in Honeycomb, I put a bogus call to it in a piece of code that I know runs all the time when an app launches. The result is this crash:

E/AndroidRuntime(  476): FATAL EXCEPTION: main
E/AndroidRuntime(  476): java.lang.NoSuchMethodError: org.appcelerator.titanium.TiLaunchActivity.getInstanceCount

So I simply removed it from the Log statement where it's called. There's nothing to test, really.

Comments

  1. Bill Dawson 2011-04-15

    (from [59d25e9b26b1c97accb781be3617ef4b1aad9283]) Remove call to getInstanceCount from one log statement as it didn't seem too important and it does not exist anymore starting in api 11 (and therefore would crash in Honeycomb) [#3245] https://github.com/appcelerator/titanium_mobile/commit/59d25e9b26b1c97accb781be3617ef4b1aad9283"> https://github.com/appcelerator/titanium_mobile/commit/59d25e9b26b1...

  2. Bill Dawson 2011-04-15

    BTW, I went through the list of all methods deleted from api 11, and this was the only one we called, and we called it only in this one place.

  3. pete 2011-04-15

    I obviously do not fully understand this but is it possible to remove the getInstanceCount code from my own project? My app currently crashes immediately on load.

  4. pete 2011-04-15

    Ignore my comment...I used mobilesdk 1.7 and it worked. Thanks.

JSON Source