{ "id": "172743", "key": "TIMOB-26744", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "2020-09-17T01:43:27.000+0000", "created": "2018-12-14T06:45:05.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [ { "id": "58732", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "173956", "key": "TIMOB-27297", "fields": { "summary": "Android: Allow Hyperloop to access Titanium's core Java classes", "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": "Low", "id": "4" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-09-17T01:43:27.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": "Accessing SDK classes like below gives null results using Hyperloop.\r\n{noformat}\r\nvar IntentProxy = require('org.appcelerator.titanium.proxy.IntentProxy'); \r\n// IntentProxy is null always\r\n{noformat}\r\n\r\nMany times we need these classes to do native things in Hyperloop like defining interfaces, casting Titanium objects to native objects and much more.\r\n\r\nThis requirement came up when I was trying to call a third-party library intent like below:\r\n\r\n{noformat}\r\nvar libIntent = SomeThirdPartyLib.getActivity().getIntent();\r\nTi.Android.currentActivity.startActivityForResult(libIntent, function() {});\r\n\r\n// Above call crashes the app throwing this error:\r\n// [ERROR] : zygote: JNI ERROR (app bug): attempt to pass an instance of hyperloop.InstanceProxy as argument 1 to void org.appcelerator.titanium.proxy.ActivityProxy.startActivityForResult(org.appcelerator.titanium.proxy.IntentProxy, org.appcelerator.kroll.KrollFunction)\r\n{noformat}\r\n\r\n\r\nSo I had 2 options to achieve what I wanted to do:\r\n* Either cast native Android Intent into a Titanium Intent and use it in Titanium's *startActivityForResult* method call to get the results back in passed callback function. Unfortunately this is not possible at present anyhow.\r\n\r\n* Use native Android Activity's *startActivityForResult* method with the native Intent but then we cannot get the results back as we do not have any `onActivityResult` method available on Titanium Activity.\r\n\r\n\r\nHowever, I am not sure whether having the access to Ti SDK classes will solve this problem, but seems that *Solution #2* might work if we have support for *onActivityResult* method on Titanium Activity.", "attachment": [], "flagged": false, "summary": "Hyperloop : Add support for accessing Titanium SDK inbuilt Android classes", "creator": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "456925", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This was implemented in Titanium 9.0.0 via [TIMOB-27297].", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-17T01:43:21.000+0000", "updated": "2020-09-17T01:43:21.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }