[TIMOB-3245] Android: getInstanceCount() (code in TiLauncherActivity) no longer exists in api 11 and app crashes if it's called
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T02:01:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint-2011-09 |
Components | Android |
Labels | android, defect, honeycomb, release-1.7.0, reported-1.6.0 |
Reporter | Bill Dawson |
Assignee | Bill Dawson |
Created | 2011-04-15T03:40:19.000+0000 |
Updated | 2011-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.
(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...
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.
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.
Ignore my comment...I used mobilesdk 1.7 and it worked. Thanks.