Magma Expert Licensed User Longtime User Nov 4, 2022 #1 Hi there... my little-knowledge to java limit me again.. :-( is it possible from inline java send an array of object or list to B4J... whatever... and how ? I have a byte array and an integer - how i will do that... until now... Code: Copy anywheresoftware.b4a.objects.collections.List list = new anywheresoftware.b4a.objects.collections.List(); list.setObject(finalCompressedArray); list.setObject(decompressedLength); ba.raiseEventFromUI(this, "myback", list); //this ...but i think i am wrong... because getting: src\b4j\example\cap.java:305: error: incompatible types: byte[] cannot be converted to List<Object> list.setObject(finalCompressedArray); Click to expand...
Hi there... my little-knowledge to java limit me again.. :-( is it possible from inline java send an array of object or list to B4J... whatever... and how ? I have a byte array and an integer - how i will do that... until now... Code: Copy anywheresoftware.b4a.objects.collections.List list = new anywheresoftware.b4a.objects.collections.List(); list.setObject(finalCompressedArray); list.setObject(decompressedLength); ba.raiseEventFromUI(this, "myback", list); //this ...but i think i am wrong... because getting: src\b4j\example\cap.java:305: error: incompatible types: byte[] cannot be converted to List<Object> list.setObject(finalCompressedArray); Click to expand...
Solution OliverA Nov 4, 2022 Magma said: list.setObject(finalCompressedArray); list.setObject(decompressedLength); Click to expand... should be Java: Copy list.Add(finalCompressedArray); list.Add(decompressedLength); You should also be able to do Java: Copy ba.raiseEventFromUI(this, "myback", new Object[] {finalCompressedArray, decompressedLength); And your sub would be Code: Copy Public Sub myback(compressed As Byte(), length As Int) End Sub
Magma said: list.setObject(finalCompressedArray); list.setObject(decompressedLength); Click to expand... should be Java: Copy list.Add(finalCompressedArray); list.Add(decompressedLength); You should also be able to do Java: Copy ba.raiseEventFromUI(this, "myback", new Object[] {finalCompressedArray, decompressedLength); And your sub would be Code: Copy Public Sub myback(compressed As Byte(), length As Int) End Sub
OliverA Expert Licensed User Longtime User Nov 4, 2022 #2 Magma said: list.setObject(finalCompressedArray); list.setObject(decompressedLength); Click to expand... should be Java: Copy list.Add(finalCompressedArray); list.Add(decompressedLength); You should also be able to do Java: Copy ba.raiseEventFromUI(this, "myback", new Object[] {finalCompressedArray, decompressedLength); And your sub would be Code: Copy Public Sub myback(compressed As Byte(), length As Int) End Sub Upvote 1 Solution
Magma said: list.setObject(finalCompressedArray); list.setObject(decompressedLength); Click to expand... should be Java: Copy list.Add(finalCompressedArray); list.Add(decompressedLength); You should also be able to do Java: Copy ba.raiseEventFromUI(this, "myback", new Object[] {finalCompressedArray, decompressedLength); And your sub would be Code: Copy Public Sub myback(compressed As Byte(), length As Int) End Sub
Magma Expert Licensed User Longtime User Nov 4, 2022 #3 OliverA said: should be Java: Copy list.Add(finalCompressedArray); list.Add(decompressedLength); You should also be able to do Java: Copy ba.raiseEventFromUI(this, "myback", new Object[] {finalCompressedArray, decompressedLength); And your sub would be Code: Copy Public Sub myback(compressed As Byte(), length As Int) End Sub Click to expand... Thanks for explaining! Upvote 0
OliverA said: should be Java: Copy list.Add(finalCompressedArray); list.Add(decompressedLength); You should also be able to do Java: Copy ba.raiseEventFromUI(this, "myback", new Object[] {finalCompressedArray, decompressedLength); And your sub would be Code: Copy Public Sub myback(compressed As Byte(), length As Int) End Sub Click to expand... Thanks for explaining!