{ "id": "85025", "key": "TIMOB-7248", "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": "2012-03-07T05:59:00.000+0000", "created": "2012-01-17T06:53:32.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:44:11.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": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Problem\r\n\r\nWhen deciding how an app should handle an incoming Android Intent, knowing the type, action, and data values that were sent with the Intent are critical. If your app only handles one very specific Intent, this is OK, but if you have an app that handles images, URIs, video,, etc... you need to know these values. \r\n\r\nRight now when an Intent is received via Intent Filter in Titanium, the following lists the values/errors you will get for the data, type, and action functions and properties of an Intent:\r\n\r\n* {{getData()}} always equals {{null}} \r\n* {{getType()}} and {{getAction()}} always throw this exception, despite the fact that logic and documentation dictates that these functions do not require arguments:\r\n{code}Uncaught Error: Requires property name as first argument{code}\r\n* The {{data}} property always returns {{null}}\r\n* The {{action}} and {{type}} properties always return {{undefined}}\r\n\r\nh2. Proposed Solution\r\n\r\nThe above listed functions and properties need to return the appropriate values for {{data}}, {{type}}, and {{action}} so that developers will know what to do with the Android Intent that they are receiving. Like I said, if you are handling only one type of data as dictated by your Intent Filter, you are OK. But if you plan to handle images, video, etc... and you need to read them from Ti.Android.EXTRA_STREAM, you have no way of knowing which type of Intent you are receiving.\r\n\r\nAlso, I believe the implementation of {{getAction()}} and {{getType()}} need to change so that they do not require a parameter.", "attachment": [], "flagged": false, "summary": "Android: Intent - getData(), getAction(), and getType() do not work", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK version: 1.8.0.1\r\nJavascript Engine: Rhino & V8 \r\nPlatform & version: Android 2.2+\r\nDevice Details: Android emulator & device (Droid X)\r\nHost Operating System: OSX 10.7.2 \r\nTitanium Studio version: 1.0.7.201112132151", "comment": { "comments": [ { "id": "185329", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Duplicate of TIMOB-7249", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-07T05:59:00.000+0000", "updated": "2012-03-07T05:59:00.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }