Sub Button1_Click
Dim mp As Map=GetJavaMap
Dim s As Int=mp.Size
xui.MsgboxAsync("Size", s)
End Sub
Public Sub GetJavaMap() As Map
Dim m As Map
m.Initialize
Dim mo As JavaObject = Me
m=mo.RunMethod("getMyMap", Null)
Return m
End Sub
#if java
import java.lang.reflect.*;
import java.io.Console;
import anywheresoftware.b4a.*;
import anywheresoftware.b4a.objects.collections.Map;
public static Map getMyMap()
{
Map mpPrt = new Map();
mpPrt.Initialize();
Map mp = new Map();
mp.Initialize();
mp.Put(1,"Test 1");
mp.Put(2,"Test 2");
mpPrt.Put(1,mp);
mp.Initialize();
mp.Put(3,"Test 3");
mp.Put(4,"Test 4");
mpPrt.Put(2,mp);
return mpPrt;
}
#End If