use of layout.CustomAdapter_Prestamos in project AdMoney by ErnestoGonAr.
the class Reporte_Prestamos method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reporte__prestamos);
bd = new BDHandlerAM(this);
RecyclerView rv = (RecyclerView) findViewById(R.id.recycler_prestamos);
try {
String[][] dataSet = bd.obtenerPrestamos();
LinearLayoutManager ln = new LinearLayoutManager(this);
ln.setOrientation(LinearLayoutManager.VERTICAL);
CustomAdapter_Prestamos adapter = new CustomAdapter_Prestamos(dataSet);
rv.setLayoutManager(ln);
rv.setAdapter(adapter);
} catch (ArrayIndexOutOfBoundsException e) {
Toast toast = Toast.makeText(this, "No hay prestamos", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
}
Aggregations