For images loading from your drawable folder you shouldn't have too
much of a problem and there isn't too much you can do about it (apart
from perhaps not load any thumbnails while the user is scrolling - as
per the Contacts app on 2.1+)

For HTTP images, and possibly images from the SD card depending on how
large your thumbnails are, you'll want to
a) Load them in a separate thread, and
b) Not load any while the user is scrolling

On Jul 23, 8:14 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> Try getting rid of the icons briefly. If scrolling speed improves
> dramatically, then the problem is in your icons. This would
> particularly be true if the values you are trying to put into the
> ImageView are HTTP URLs or something.
>
>
>
> On Fri, Jul 23, 2010 at 3:10 PM, QR <qro...@gmail.com> wrote:
> >   I'm getting some very jerky scrolling while using the code below to
> > create a ListView from a Cursor. Is there something I'm doing wrong,
> > or any way to improve the performance of this ListView?
>
> > bookmarksListView = (ListView)findViewById(R.id.bookmarks_listview);
> >                        bookmarksDbCursor = bookmarkStore.getCursor();
> >                        startManagingCursor(bookmarksDbCursor);
> >                        String[] bookmarksColumns = new String[3];
> >                        bookmarksColumns[0] = "TITLE";
> >                        bookmarksColumns[1] = "URL";
> >                        bookmarksColumns[2] = "ICONID";
> >                        int[] bookmarksViews = new int[3];
> >                        bookmarksViews[0] = R.id.title_text;
> >                        bookmarksViews[1] = R.id.subtitle_text;
> >                        bookmarksViews[2] = R.id.icon_view;
> >                        bookmarksListAdapter = new SimpleCursorAdapter(this,
> >                                        R.layout.list_item,
> >                                        bookmarksDbCursor,
> >                                        bookmarksColumns,
> >                                        bookmarksViews);
> >                        bookmarksListView.setAdapter(bookmarksListAdapter);
> >                        bookmarksListView.setOnItemClickListener(new 
> > OnItemClickListener()
> > {
> >                               �...@override
> >                                public void onItemClick(AdapterView<?> 
> > parent, View view,
> >                                                int position, long id) {
> >                                        
> > Toast.makeText(BookmarkHistoryTabActivity.this, "Clicked ID " +
> > Long.toString(id), Toast.LENGTH_SHORT).show();
> >                                }
> >                        });
> >                        registerForContextMenu(bookmarksListView);
>
> > Note: bookmarkStore.getCursor() returns an unmanaged cursor from a
> > sqlite database containing the columns from bookmarksColumns.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Development Wiki:http://wiki.andmob.org

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to