Created
December 15, 2016 11:53
-
-
Save dario61081/8f142064868dad58c0751dfe8a1a7e6e to your computer and use it in GitHub Desktop.
Poblar listview utilizando list<type>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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