{ "id": "166203", "key": "TIMOB-24427", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2019-01-11T03:40:33.000+0000", "created": "2017-02-21T21:02:01.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "activity", "alloy", "android" ], "versions": [], "issuelinks": [ { "id": "57116", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "171712", "key": "TIMOB-26075", "fields": { "summary": "Android: Refactor app resume and \"newintent\" handling", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-01-11T03:40:37.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "We have a need to utilize multiple activities within our titanium/alloy application. This is a very common paradigm for Android development. However, the basic example is not able to work properly. We have created a Stack Exchange issue (http://stackoverflow.com/questions/42376926/how-to-create-an-appcelerator-alloy-android-application-with-multiple-activities) as well as a github repo demonstrating the problem (https://github.com/DaKaZ/multiactive).\r\n\r\nIt would be possible to work around the problem IF titanium would update `Ti.Android.currentActivity.intent` if the activity is re-launched with a new intent. That way we could the information on the extra keys in the current activity.", "attachment": [], "flagged": false, "summary": "Alloy app started from secondary activity fails horribly", "creator": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 5.x, 6.x.", "closedSprints": [ { "id": 1106, "state": "closed", "name": "2019 Sprint 1", "startDate": "2018-12-31T19:39:58.070Z", "endDate": "2019-01-11T19:39:00.000Z", "completeDate": "2019-01-14T17:17:47.552Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "407503", "author": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Note, if you run on an android emulator instead of device, this additional error message is displayed:\r\n\r\n[INFO] W/System.err( 2919): java.lang.NullPointerException: Attempt to read from field 'com.android.server.am.TaskRecord com.android.server.am.ActivityRecord.task' on a null object reference\r\n\r\n", "updateAuthor": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-21T21:08:03.000+0000", "updated": "2017-02-21T21:08:03.000+0000" }, { "id": "407584", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Please we need some clear instructions. I can run the app on device and click on the \"Open Model\" text. This opens the model window with \"No message\" text in the middle. Please provide clear instruction to successfully regenerate the issue. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-02-22T16:29:25.000+0000", "updated": "2017-02-22T16:29:25.000+0000" }, { "id": "407595", "author": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The main instructions are in the README of the gitbub. But in trying to find a work around I found an even larger issue: the Ti.Android.currentActivity.getIntent() does NOT return the current intent. Pull the latest code, build and install the app. Then do this:\r\n\r\n# Kill the app so that it is not running in the foreground or background\r\n# issue this adb command `adb shell am start -W -a android.intent.action.VIEW -d \"multiactive://blocked/testing\" com.kaztopia.multiactive`\r\n# You should see the app open and display in an alert \"multiactive://blocked/testing\"\r\n# Now issue this command: `adb shell am start -W -a android.intent.action.VIEW -d \"multiactive://blocked/example\" com.kaztopia.multiactive`\r\n# You should see \"multiactive://blocked/example\" BUT you still see \"multiactive://blocked/testing\"\r\n\r\nIt appears that Ti is unable to pull the current intent.", "updateAuthor": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-22T17:19:38.000+0000", "updated": "2017-02-22T17:19:38.000+0000" }, { "id": "407618", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I was able to reproduce the behavior described in the github readme. Unfortunately the behavior according to your last comment I wasn't able to reproduce. I got \"Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=multiactive://blocked/testing flg=0x10000000 pkg=com.kaztopia.multiactive VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} }\" Am I missing something? ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-02-22T19:47:57.000+0000", "updated": "2017-02-22T19:47:57.000+0000" }, { "id": "407627", "author": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Sharif,\r\n\r\nI just double checked - the first time I just get a '\"black\" screen. The second time I used the adb command I get the error message (same result though, just a black screen):\r\n\r\n{{\r\nMikes-MacBook-Pro:multiactive kaz$ /Users/kaz/Library/Android/sdk/platform-tools/adb shell am start -n \"com.kaztopia.multiactive/.SecondActivityActivity\" -a android.intent.action.VIEW -c android.intent.category.DEFAULT -e \"message\" \"HERE_I_AM\"\r\nStarting: Intent { act=android.intent.action.VIEW cat=[android.intent.category.DEFAULT] cmp=com.kaztopia.multiactive/.SecondActivityActivity (has extras) }\r\nMikes-MacBook-Pro:multiactive kaz$ /Users/kaz/Library/Android/sdk/platform-tools/adb shell am start -n \"com.kaztopia.multiactive/.SecondActivityActivity\" -a android.intent.action.VIEW -c android.intent.category.DEFAULT -e \"message\" \"HERE_I_AM\"\r\nStarting: Intent { act=android.intent.action.VIEW cat=[android.intent.category.DEFAULT] cmp=com.kaztopia.multiactive/.SecondActivityActivity (has extras) }\r\nWarning: Activity not started, its current task has been brought to the front\r\n}}", "updateAuthor": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-22T21:38:09.000+0000", "updated": "2017-02-22T21:38:09.000+0000" }, { "id": "407630", "author": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-22T22:02:33.000+0000", "updated": "2017-02-22T22:03:30.000+0000" }, { "id": "407834", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Moving to TIMOB for farther process. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-02-23T20:10:33.000+0000", "updated": "2017-02-23T20:10:33.000+0000" }, { "id": "408068", "author": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Today I updated https://github.com/DaKaZ/multiactive.git with this some additional information.\r\n\r\nFirst, regarding the second activity problem. I was able to get the error to consistently show up in logcat if you try to launch the second activity without the first activity running:\r\n\r\nHere is the error:\r\n\r\nE/TiApplication( 7151): (main) [110,246] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to resume activity {com.kaztopia.multiactive/com.kaztopia.multiactive.SecondActivityActivity}: java.lang.IllegalStateException: APSAnalytics has not been enabled. Call APSAnalytics.getInstance().enable(ctx, key, deploytype) to enable.; Titanium 6.0.2,2017/02/15 16:26,undefined\r\nE/TiApplication( 7151): java.lang.RuntimeException: Unable to resume activity {com.kaztopia.multiactive/com.kaztopia.multiactive.SecondActivityActivity}: java.lang.IllegalStateException: APSAnalytics has not been enabled. Call APSAnalytics.getInstance().enable(ctx, key, deploytype) to enable.\r\nE/TiApplication( 7151): \tat android.app.ActivityThread.performResumeActivity(ActivityThread.java:2951)\r\nE/TiApplication( 7151): \tat android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2982)\r\nE/TiApplication( 7151): \tat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)\r\nE/TiApplication( 7151): \tat android.app.ActivityThread.access$800(ActivityThread.java:144)\r\nE/TiApplication( 7151): \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)\r\nE/TiApplication( 7151): \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\nE/TiApplication( 7151): \tat android.os.Looper.loop(Looper.java:135)\r\nE/TiApplication( 7151): \tat android.app.ActivityThread.main(ActivityThread.java:5221)\r\nE/TiApplication( 7151): \tat java.lang.reflect.Method.invoke(Native Method)\r\nE/TiApplication( 7151): \tat java.lang.reflect.Method.invoke(Method.java:372)\r\nE/TiApplication( 7151): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)\r\nE/TiApplication( 7151): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)\r\nE/TiApplication( 7151): Caused by: java.lang.IllegalStateException: APSAnalytics has not been enabled. Call APSAnalytics.getInstance().enable(ctx, key, deploytype) to enable.\r\nE/TiApplication( 7151): \tat com.appcelerator.aps.APSAnalytics.throwUnlessEnabled(APSAnalytics.java:252)\r\nE/TiApplication( 7151): \tat com.appcelerator.aps.APSAnalytics.sendAppForegroundEvent(APSAnalytics.java:132)\r\nE/TiApplication( 7151): \tat org.appcelerator.titanium.TiBaseActivity.onResume(TiBaseActivity.java:1324)\r\nE/TiApplication( 7151): \tat org.appcelerator.titanium.TiLaunchActivity.onResume(TiLaunchActivity.java:433)\r\nE/TiApplication( 7151): \tat ti.modules.titanium.android.TiJSActivity.onResume(TiJSActivity.java:42)\r\nE/TiApplication( 7151): \tat android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1241)\r\nE/TiApplication( 7151): \tat android.app.Activity.performResume(Activity.java:6023)\r\nE/TiApplication( 7151): \tat android.app.ActivityThread.performResumeActivity(ActivityThread.java:2940)\r\nE/TiApplication( 7151): \t... 11 more", "updateAuthor": { "name": "dakazmier", "key": "dakazmier", "displayName": "Michael Kazmier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-27T20:51:38.000+0000", "updated": "2017-02-27T20:51:38.000+0000" }, { "id": "417460", "author": { "name": "engross", "key": "engross", "displayName": "Dongwoo Gim", "active": true, "timeZone": "Asia/Seoul" }, "body": "I have the same problem.\r\nI avoided by making analytics false in tiapp.xml.\r\nfalse", "updateAuthor": { "name": "engross", "key": "engross", "displayName": "Dongwoo Gim", "active": true, "timeZone": "Asia/Seoul" }, "created": "2017-04-15T14:31:45.000+0000", "updated": "2017-04-15T14:31:45.000+0000" }, { "id": "445206", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue has been resolved in Titanium 8.0.0. Please see: [TIMOB-26075]", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-01-11T03:39:12.000+0000", "updated": "2019-01-11T03:39:12.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }