die_for_rock_vn
Lurker
I'm trying to make a very simple applicaton - an Youtube app. This app has a ListView, which shows a thumbnail and a title for each Youtube video. (I use sample code from code.google.com/p/youtube-api-samples/source/browse/android-player/src/com/examples/youtubeapidemo/VideoListDemoActivity.java - I can't post full link because I'm a new member, just copy it and paste to browser)
But it lag so much when I scroll this ListView(run on Motorola XT800W Android 2.3.4) How to make it smoother? I try to run thumbnailLoader.setVideo(videoId) in background thread but it still lags when app starts and thumbnails do not finish loading yet. After all thumbnails loaded, it's smoother but still lags a little bit. Code:
[HIGH]final String videoId = videoentry.videoId;
new AsyncTask<YouTubeThumbnailLoader, Void, YouTubeThumbnailLoader>() {
@Override
protected YouTubeThumbnailLoader doInBackground(
YouTubeThumbnailLoader... params) {
// TODO Auto-generated method stub
YouTubeThumbnailLoader v = params[0];
v.setVideo(videoId);
return v;
}
}.execute(youtubethumbnailloader);[/HIGH]
But it lag so much when I scroll this ListView(run on Motorola XT800W Android 2.3.4) How to make it smoother? I try to run thumbnailLoader.setVideo(videoId) in background thread but it still lags when app starts and thumbnails do not finish loading yet. After all thumbnails loaded, it's smoother but still lags a little bit. Code:
[HIGH]final String videoId = videoentry.videoId;
new AsyncTask<YouTubeThumbnailLoader, Void, YouTubeThumbnailLoader>() {
@Override
protected YouTubeThumbnailLoader doInBackground(
YouTubeThumbnailLoader... params) {
// TODO Auto-generated method stub
YouTubeThumbnailLoader v = params[0];
v.setVideo(videoId);
return v;
}
}.execute(youtubethumbnailloader);[/HIGH]