I have a database and based on this I create buttons with a name, but I can not find a method that puts one button under another. I know it can be done in the .xml with the layout_below="" but dynamically I do not see a method to position them one below the other.
public void completaVista()
{
SQLiteDatabase db = this.mBD.getReadableDatabase();
Cursor c = db.rawQuery("SELECT * FROM "+ManejadorBaseDatos.DatosTabla1.NOMBRE_TABLA,null);
while (c.moveToNext())
{
ScrollView svMaterias = (ScrollView) findViewById(R.id.svMaterias);
RelativeLayout rlNuevo = recuadroMateria(c.getString(0)); // me devuelve un Relative Layout con cosas adentro
svMaterias.addView(rlNuevo);
ImageButton ibAgrega = (ImageButton) findViewById(R.id.btnNewSubject);
//Algun procedimiento para que ibAgrega este debajo de rlNuevo
}
}