Hi,
The following code shows how I solved the problem, *I need to know if there
is a simpler way to do it.*
Response<Map> jMenu = Rest.get(SERVER_URL +
"usuario/busquedaMenu").queryParam("token", Preferences.get("token",
null)).acceptJson().getAsJsonMap();
if (jMenu.getResponseCode() != 200) {
Dialog.show("Error", "Lo sentimos, No existe un MenĂº definido
para esta empresa", "Continuar", null);
return;
}
Map<Integer, Menu> m = jMenu.getResponseData();
ArrayList tMenu = (ArrayList)
Result.fromContent(m).getAsArray("root");
ArrayList aMenu = new ArrayList();
for (int i = 0; i < tMenu.size(); i++) {
aMenu.add(populaRegistroMenu(tMenu.get(i)));
}
private Menu populaRegistroMenu(Object r) {
Menu m = new Menu();
m.getPropertyIndex().populateFromMap((Map) r);
return m;
}
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/c96bd065-0601-483c-b204-6c7df18bb827%40googlegroups.com.