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 <[email protected]> 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/commonsguy http://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 [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

