NativeScript android本机库实现

NativeScript android本机库实现,android,nativescript,Android,Nativescript,我正试图在我的一个项目中实施以下内容: let activity = app.android.foregroundActivity || app.android.startActivity; let i = android.content.Intent(activity, com.picker.gallery.view.PickerActivity.class) i.putExtra("IMAGES_LIMIT", 4) i.putExtra("VIDEOS_LIMIT", 1) i.putEx

我正试图在我的一个项目中实施以下内容:

let activity = app.android.foregroundActivity || app.android.startActivity;
let i = android.content.Intent(activity, com.picker.gallery.view.PickerActivity.class)
i.putExtra("IMAGES_LIMIT", 4)
i.putExtra("VIDEOS_LIMIT", 1)
i.putExtra("REQUEST_RESULT_CODE", 101)
app.android.foregroundActivity.startActivityForResult(i, 101);
但我得到了这个错误:

ERROR Error: Trying to link invalid 'this' to a Java object
JS: ERROR CONTEXT {
JS:   "view": {
JS:     "def": {
JS:       "nodeFlags": 33603585,
JS:       "rootNodeFlags": 33554433,
JS:       "nodeMatchedQueries": 0,
JS:       "flags": 0,
JS:       "nodes": [
JS:         {
JS:           "nodeIndex": 0,
JS:           "parent": null,
JS:           "renderParent": null,
JS:           "bindingIndex": 0,
JS:           "outputIndex": 0,
JS:           "checkIndex": 0,

在我犯错误的地方?提前感谢

看起来您没有创建新的Intent实例,这可能是您的问题

所以

new android.content.Intent(...