OpenGLRenderer is out of memory

半世苍凉 提交于 2019-12-13 20:53:28

问题


I am trying to create a table layout filled with lots of bits of data, the table layout is inside a scroll view.

I am using this to fill it

TableLayout tl;

.....

tl = (TableLayout) findViewById(R.id.layout);

.....

and when I set it I create a new Text View to put into it like so

TextView tv;

....

tr = new TableRow(Context);

.....
tv = new TextView(Context);
tv.setText(progress[1]);
tr.addView(tv);
...
tl.addView(tr);

A new text row is created when I have put 12 text views in it and the tr is added to the tl when it has 12 views in it.

The font size of the text view is default, all I do to the text view you see here


回答1:


Consider changing to a viewgroup that can recycle/reuse its child views, such as a listview or gridview. That way you won't need to keep everything in memory.



来源:https://stackoverflow.com/questions/11043125/openglrenderer-is-out-of-memory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!