情報が到着するのを待つテーブルレイアウトがあります。データが到着すると、テーブルに動的に入力します。しかし、電話を90度回転させると、テーブルが消えます。コード:
{
TableRow row;
TextView t1, t2;
ArrayList<InfoPair> values;
values = processResults(r);
Iterator it = values.iterator();
while (it.hasNext()) {
InfoPair pairs = (InfoPair) it.next();
row = new TableRow(c);
t1 = new TextView(c);
t2 = new TextView(c);
// t1.setTextLocale(new Locale("hu", "hu"));
t1.setText(pairs.getLabel());
t2.setText(pairs.getValue());
t1.setWidth(200);
t2.setWidth(280);
t1.setBackgroundColor(Color.GRAY);
t2.setBackgroundColor(Color.YELLOW);
row.addView(t1);
row.addView(t2);
infoTable.addView(row);
it.remove(); // avoids a ConcurrentModificationException
}
テーブルに情報を保持し、電話を回したときに消えないようにするにはどうすればよいですか?