[AC-921] Crash when launching root activity from another activity
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2015-02-03T15:03:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Appcelerator Modules |
Labels | android |
Reporter | DeRon Brown |
Assignee | Shuo Liang |
Created | 2015-01-15T21:22:47.000+0000 |
Updated | 2016-03-08T07:37:13.000+0000 |
Description
We are building a Notification for GCM and using an activity that is *not* the main, launcher activity (i.e. the activity that extends TiRootActivity) within the PendingIntent. This activity has no UI, but instead simply tracks some information regarding the notification being clicked and then launches the main, launcher activity from within its onCreate() method. Similar to the following: https://gist.github.com/deronbrown/d392418360b7c80fa57a
This works as expected most of the time. However, if the app is out of memory when the notification is tapped (i.e. show the GCM notification, open recent apps menu, remove app, then tap notification), the launch activity will not be shown. Instead, the user will see a quick flash of UI and then be dropped back to their previous state (e.g. home screen or wherever the user was when the notification was tapped).
Logs show the proper intent to start the main activity but the activity never displays. This same bug does not appear if you use the main, launcher activity in the PendingIntent. Perhaps TiRootActivity is doing some specific Titanium setup, and when another activity is used this setup does not occur. We were not able to determine the important setup that our activity should be doing based on the TiRootActivity source that is available.
*Test Case:*
* Create TestActivity for PendingIntent: https://gist.github.com/deronbrown/a9e018762ddabb85f272
* Show a notification using TestActivity in the PendingIntent: https://gist.github.com/deronbrown/939e4956effaa9528215
* Once notification displays, open recent apps menu and swipe the Test app away. (Note: This is not the same as force closing).
* Tap the notification to launch the application.
*Expected:* TestActivity should be created, print to logcat, and launch the main activity which should be displayed to the user.
*Actual:* TestActivity is created, prints to logcat, and the user is returned to their initial state before tapping notification. (Main Activity never displays.)
HI, Please provide a simple test case to reproduce your problem. That will be really helpful to address the problem. Regards, Shuo
[~sliang] I have added a test case the end of the description.
Hello, please read this guide: http://docs.appcelerator.com/titanium/3.0/#!/guide/How_to_Submit_a_Bug_Report and provide a testcase in the form of app.js single file. Best Regards