Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20502] Using Android shortcut to start new activity fails to detect Alloy.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-09-30T16:22:30.000+0000
Affected Version/sRelease 5.2.0, Release 5.1.1
Fix Version/sRelease 6.0.0, Release 6.1.0
ComponentsAndroid
LabelsAndroid, Intent
ReporterMotiur Rahman
AssigneeGary Mathews
Created2016-03-02T17:27:03.000+0000
Updated2016-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 instance

Attachments

FileDateSize
App.zip2016-03-02T17:29:56.000+00009039
tiapp.xml2016-03-02T17:21:43.000+00005752

Comments

  1. Mostafizur Rahman 2016-03-22

    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.
  2. Collin Price 2016-03-22

    SDK 5.1.2.GA does not include the fix to add a shortcut. This was introduced in 5.2.0.GA.
  3. Gary Mathews 2016-09-14

    master: https://github.com/appcelerator/titanium_mobile/pull/8326 NOTE: This requires TIMOB-23881
  4. Gary Mathews 2016-09-26

    master: https://github.com/appcelerator/titanium_mobile/pull/8433
  5. Chee Kiat Ng 2016-10-03

    [~gmathews] please backport.
  6. Lokesh Choudhary 2016-10-04

    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
  7. Lokesh Choudhary 2016-10-06

    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

JSON Source