[TIMOB-24021] Hyperloop: Android: require of native class android.content.Intent fails on SDK 6+
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-10-12T21:12:30.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 6.0.0, Hyperloop 2.0.0 |
| Components | Android, Hyperloop |
| Labels | n/a |
| Reporter | Christopher Williams |
| Assignee | Christopher Williams |
| Created | 2016-10-12T19:57:55.000+0000 |
| Updated | 2016-10-20T22:28:15.000+0000 |
Description
Because we're still using legacy style require paths for hyperloop wrappers, we're running into issues with Hyperloop 2.0.0 and SDK 6+, just as we did on iOS in TIMOB-23971
To test, try this as your app.js in a hyperloop project:
var Intent = require('android.content.Intent'); var Activity = require('android.app.Activity'); var Uri = require("android.net.Uri"); var win = Ti.UI.createWindow({ backgroundColor: "#fff" }); var btn = Ti.UI.createButton({ title: "Trigger" }); btn.addEventListener("click", openIntent); win.add(btn); win.open(); function openIntent() { var activity = new Activity(Ti.Android.currentActivity); var intent = Ti.Android.createIntent({ action: Ti.Android.ACTION_VIEW }); var nativeIntent = new Intent(intent); nativeIntent.setData(Uri.parse("sms://")); nativeIntent.putExtra("sms_body", "Hello world!"); activity.startActivity(nativeIntent); }PR (master): https://github.com/appcelerator/hyperloop.next/pull/86 PR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/85
Verified the fix. Require of native class android.content.Intent works as expected. Closing. Appc Studio : 4.8.0.201610171310 Mac OS Version : 10.11.6 Xcode Version : Xcode 8.0 Build version 8A218a Appc CLI AND Appc NPM : {"NPM":"4.2.8-9","CLI":"6.0.0-62"} Ti CLI : 5.0.10 Alloy : 1.9.3 Node : v4.6.0 SDK Version : 6.0.0.v20161019091022 Environment: preprod