On some phones like sony ericsson xperia arc lag is normal but a phone like
htc wildfire cant handle table like that.
When trying to scroll to any direction, you can`t scroll back, and the
proccess to create table and go back to menu takes huge amount of time (
around 10 secs )
This is how i create a table :
TableLayout tl = (TableLayout) this.findViewById(R.id.plusminustable);
TableRow tr = null;
TextView child = null;
LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
tl.setPadding(0, 0, 0, 10);
for (int i = 0; i < counter; i++) {
tr = new TableRow(this);
if (i % 2 == 0) {
tr.setBackgroundResource(R.color.tableOdd);
}
for (int j = 0; j < data.size(); j++) {
tableColumn = data.get(j);
child = new TextView(this);
child.setTextColor(R.color.text);
child.setPadding(10, 5, 10, 5);
if (tableColumn[i].startsWith("HEADER_")) {
tableColumn[i] = tableColumn[i].substring(7);
tr.setBackgroundResource(R.color.plusMinusHeader);
child.setTypeface(null, Typeface.BOLD);
child.setGravity(16);
}
child.setText(tableColumn[i]);
tr.addView(child);
}
tl.addView(tr,params);
}
data is ArrayList<String[]> and i hold one column info there, so its 13
size array list with 13 string arrays.
Could this process be to hard for some phones to deal with? To get info for
the table i keep in in res/values/strings.xml, i dont use any databases.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en