[TIMOB-20502] Using Android shortcut to start new activity fails to detect Alloy.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-09-30T16:22:30.000+0000 |
Affected Version/s | Release 5.2.0, Release 5.1.1 |
Fix Version/s | Release 6.0.0, Release 6.1.0 |
Components | Android |
Labels | Android, Intent |
Reporter | Motiur Rahman |
Assignee | Gary Mathews |
Created | 2016-03-02T17:27:03.000+0000 |
Updated | 2016-10-06T00:10:32.000+0000 |
Description
Issue Description
We have created a sample app that has a button which creates a shortcut. That shortcut is supposed to open "test.js" controller. Two scenarios are possible here - an app is already running when the shortcut is pressed or app is being started via shortcut. The first scenario works exactly the way we desire. In the second scenario, it seems that Alloy that is being loaded is not the same as the one we define. To showcase it we have put a label in test.js controller which is supposed to have a value of "TEST STRING" in the successful scenario.Steps to Reproduce:
Run attached sample code.
Press "Hello World" button to create a shortcut.
Pause the app via home button
Click shortcut. Test controller should load and a string with a value of "TEST STRING" is present.
Kill the app
Restart the app via shortcut
Observe empty string
Expected Behavior*
- Being able to open different controllers from sample.js and being able to load proper Alloy instanceAttachments
File | Date | Size |
---|---|---|
App.zip | 2016-03-02T17:29:56.000+0000 | 9039 |
tiapp.xml | 2016-03-02T17:21:43.000+0000 | 5752 |
Hello, I tested the issue with sample code provided by the reporter. I am able to reproduce the issue with SDK 5.2.0 GA . But not been able to reproduce with SDK 5.1.2 GA (No shortcut created). *Test Environment:* Appcelerator Studio, build: 4.5.0.201602170821, Operating System Mac OS X -EI Capitan,Versio-10.11.1, Appcelerator Command-Line Interface, version 5.2.0, SDK Version = 5.2.0.GA, 5.1.2 GA, Node.js Version: 4.2.2 npm Version: 2.14.7, Device : Nexus 7/ android 6.0.1 Emulator: Custom phone / android 5.0.0 *Test steps to reproduce* 1. Create the default alloy project. 2. Replace the code by the reporter provided. 3. Run the app. 4. Click the “*Hello World*” button to create shortcut. 5. After click it will create shortcut and to get it please go home. 6. Now click on shortcut and see that test controller is loaded by the value of “*TEST STRING*”. 7. After complete above steps, please kill the app. 8. Now again click on shortcut and see empty string Thanks.
SDK 5.1.2.GA does not include the fix to add a shortcut. This was introduced in 5.2.0.GA.
master: https://github.com/appcelerator/titanium_mobile/pull/8326 NOTE: This requires TIMOB-23881
master: https://github.com/appcelerator/titanium_mobile/pull/8433
[~gmathews] please backport.
Verified the fix with master. Waiting to get back ported to 6.0.0 branch. Environment: Appc Studio : 4.8.0.201609292239 Ti CLI : 5.0.10 Alloy : 1.9.2 MAC El Capitan : 10.11.6 Appc NPM : 4.2.8-7 Appc CLI : 6.0.0-56 Node: 4.4.4 Nexus 5 - Android 6.0.1
Verified the fix with master & 6.0.0 SDK. Android shortcut to start new activity successfully detects alloy. Closing. Environment: Appc Studio : 4.8.0.201609292239 Ti SDK : 6.0.0.v20161005072811, 6.1.0.v20161005041716 Ti CLI : 5.0.10 Alloy : 1.9.2 MAC El Capitan : 10.11.6 Appc NPM : 4.2.8-7 Appc CLI : 6.0.0-56 Node: 4.4.4 Nexus 6 - Android 6.0.1