I add a TableLayout in a listView, inside the TableLayout, it contains
some photo that will be load from network in another thread, but after
load is done, I call notifyDataSetChanged of the ListView, sometime it
just redraw the item. my code look like this :
public View getView(final int position, View convertView,
ViewGroup parent) {
if (convertView == null ) {
convertView = Fanroid.this.getLayoutInflater().inflate(
R.layout.list_item, parent,false);
}
// some code to add photo into TableLayout
}
I guess maybe the Recycler of ListView reuse the current view and
think it not necessary to redraw, so I move to the "slow way" which
mentioned in Google I/O 2010 ListView session:
public View getView(final int position, View convertView,
ViewGroup parent) {
// if (convertView == null ) {
convertView = Fanroid.this.getLayoutInflater().inflate(
R.layout.list_item, parent,false);
//}
// some code to add photo into TableLayout
}
Now It work find but slow, anyone help? Thanks
--
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