0

In native script app with typescript I'm attempting to pass android.net.Uri array to a function. Then I receive the mentioned error. I read about creating Array with Array.create("classTtype", count), but can't use it (Property 'create' does not exist on type 'ArrayConstructor') - using es5. Here how I create the array actually, but it's not working: let result: android.net.Uri[] = new Array(1); result[0] = android.net.Uri.parse(dataString);

Any suggestions?

1 Answer 1

1

You're close but a problem may arise if you are not using a newer version of {N} since the typings (assuming you are using typescript) was added a couple versions ago (can't remember which) you can try the following assuming it's typescript

// ts
const result = (Array as any).create('android.net.Uri', count);
result[0] = android.net.Uri.parse(dataString);
// js
const result = Array.create('android.net.Uri', count);
result[0] = android.net.Uri.parse(dataString);

Core e.g

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.