Android marshalling help

android

#1

Hello everyone,

I am having trouble to marshalling following code:

new String[] {"xlsx", "xls", "doc", "dOcX", "ppt", ".pptx", "pdf"}

Full code is like this:

intent4.putExtra(NormalFilePickActivity.SUFFIX,
new String[] {"xlsx", "xls", "doc", "dOcX", "ppt", ".pptx", "pdf"});

I tried like this:
intent4.putExtra(NormalFilePickActivity.SUFFIX, '{"xlsx", "xls", "doc", "dOcX", "ppt", ".pptx", "pdf"}');

but didn’t work… Got this error

System.err: java.lang.NullPointerException: pattern == null

If

intent1.putExtra(NormalFilePickActivity.SUFFIX, ["xlsx", "xls", "doc", "dOcX", "ppt", ".pptx", "pdf"]);

then

System.err: Error: Cannot convert array to Landroid/os/Bundle; at index 1

Library’s link here

Any idea how can I do that? Thanks in advance


#2

OK, got it working following this: https://docs.nativescript.org/core-concepts/android-runtime/marshalling/java-to-js#array

let test = Array.create(java.lang.String, 2);
test[0] = new java.lang.String("txt");
test[1] = new java.lang.String('pdf');