Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-2953] Hyperloop fails to cast Ti Intent to native Android Intent #78

Merged
merged 1 commit into from Sep 28, 2016

Conversation

sgtcoolguy
Copy link
Contributor

https://jira.appcelerator.org/browse/TIMOB-23953

try to special case IntentProxy/Intent and ActivityProxy/Activity for method calls/constructors so that we can unwrap the titanium proxies to the native classes, or can accept titanium or native versions for any method expecting titanium or native versions.

- try to special case IntentProxy/Intent and ActivityProxy/Activity for method calls/constructors so that we can unwrap the titanium proxies to the native classes, or can accept titanium or native versions for any method expecting titanium or native versions.
- Workaround for when creation dictionary for Titanium intent isn't passed, so Intent is null.
@sgtcoolguy
Copy link
Contributor Author

To test:

var Intent = require('android.content.Intent');
var intent = Ti.Android.createIntent();
var nativeIntent = new Intent(intent); // Used to fail
Ti.API.info("worked!");

Note that I needed to add a special hack for the use case when you provide no creation dictionary to createIntent(), it never generates an internal Intent object, so unwrapping we get a null object and the cast resulted in a NullPointerException. I now explicitly check for null and if null, force a call to handleCreationDict and then re-get the wrapped Intent.

@hansemannn
Copy link
Contributor

Approved!

@hansemannn hansemannn merged commit 6346e36 into tidev:master Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants