I have certain data in sqllite and it update every time whenever, I click on save button and I want to show the data into a table layout for adding more rows for updated data.
I have certain code but it shows only the updated data replacing previous data and I want to add more rows as the data updated.
I know this is only to add one row into table layout but how can I add more rows?
TableLayout tl=(TableLayout)findViewById(R.id.maintable);
TableRow tr1 = new TableRow(this);
tr1.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
TextView textview = new TextView(this);
textview.setText(data);
//textview.getTextColors(R.color.)
textview.setTextColor(Color.YELLOW);
tr1.addView(textview);
tl.addView(tr1, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…