Skip to content

Instantly share code, notes, and snippets.

@dario61081
Created December 15, 2016 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dario61081/8f142064868dad58c0751dfe8a1a7e6e to your computer and use it in GitHub Desktop.
Save dario61081/8f142064868dad58c0751dfe8a1a7e6e to your computer and use it in GitHub Desktop.
Poblar listview utilizando list<type>
String url = "http://app.data.com/test";
Log.w("getSucursales", "Sucursales: ");
pb_sucursales.setVisibility(View.VISIBLE);
$.getJSON(url, null, new Function() {
@Override
public void invoke($ $, Object... objects) {
String valor = objects[0].toString();
List<Sucursal> sucs = new Gson().fromJson(valor, new TypeToken<List<Sucursal>>() {
}.getType());
lst_sucursales = new SucursalesAdapter(getActivity(), R.layout.layout_suc_item, sucs);
lv_sucursales.setAdapter(lst_sucursales);
lv_sucursales.setSelector(getResources().getDrawable(R.drawable.shape_btn_success));
pb_sucursales.setVisibility(View.INVISIBLE);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment