Titanium JIRA Archive
Appcelerator Community (AC)

[AC-921] Crash when launching root activity from another activity

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2015-02-03T15:03:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules
Labelsandroid
ReporterDeRon Brown
AssigneeShuo Liang
Created2015-01-15T21:22:47.000+0000
Updated2016-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.)

Comments

  1. Shuo Liang 2015-01-16

    HI, Please provide a simple test case to reproduce your problem. That will be really helpful to address the problem. Regards, Shuo
  2. DeRon Brown 2015-01-16

    [~sliang] I have added a test case the end of the description.
  3. Mauro Parra-Miranda 2015-02-03

    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

JSON Source