Jibon
Jibon

Reputation: 37

NativeScript android native library implementation

I am trying to implement GalleryPicker in one of my project like this:

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);

But I am getting this error:

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,

In where I am doing mistake? Thanks in advance

Upvotes: 0

Views: 93

Answers (1)

Brad Martin
Brad Martin

Reputation: 6177

Looks like you're not creating a new Intent instance, might be your problem.

So...

new android.content.Intent(...

Upvotes: 1

Related Questions