Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7248] Android: Intent - getData(), getAction(), and getType() do not work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2012-03-07T05:59:00.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsAndroid
Labelsandroid
ReporterTony Lukasavage
AssigneeMarshall Culpepper
Created2012-01-17T06:53:32.000+0000
Updated2014-06-19T12:44:11.000+0000

Description

Problem

When 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. Right 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: * getData() always equals null * getType() and getAction() always throw this exception, despite the fact that logic and documentation dictates that these functions do not require arguments:
Uncaught Error: Requires property name as first argument
* The data property always returns null * The action and type properties always return undefined

Proposed Solution

The 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. Also, I believe the implementation of getAction() and getType() need to change so that they do not require a parameter.

Comments

  1. Tony Lukasavage 2012-03-07

    Duplicate of TIMOB-7249

JSON Source