Java Question java util list

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Hi!

I am wrapping a library that have the following method:

B4X:
public List<Comprobante.Conceptos.Concepto> getConcepto() {
if (concepto == null) {
concepto = new ArrayList<Comprobante.Conceptos.Concepto>();
}
return this.concepto;
}
but this is seen from the IDE as java.util.list and i cannot work with it.

how can i convert it to the b4a list and use the name items:

B4X:
public anywheresoftware.b4a.objects.collections.List getItems() {

}

thanks!
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
i did it this way. it is the correct way? thanks!

B4X:
public anywheresoftware.b4a.objects.collections.List getItems() {
anywheresoftware.b4a.objects.collections.List l = new anywheresoftware.b4a.objects.collections.List();
if (concepto == null) {
concepto = new ArrayList<Comprobante.Conceptos.Concepto>();
}
l.setObject((ArrayList)concepto);
return l;
}
 
Top