URLへのリンクをサムネイルとして表現したい。現在試しているコードは次のとおりです。
public class MainActivity extends ListActivity {
ImageView imageView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
}
private void init() {
imageView = (ImageView)findViewById(R.id.imageView1);
ArrayList<String> videoLinks = new ArrayList<String>();
String links1 = "http://www.tools4movies.com/dvd_catalyst_profile_samples/Harold Kumar 3 Christmas bionic.mp4";
String links2 = "http://www.tools4movies.com/dvd_catalyst_profile_samples/The Amazing Spiderman bionic.mp4";
String links3 = "http://www.tools4movies.com/dvd_catalyst_profile_samples/Twilight 4 Breaking Dawn bionic.mp4";
String links4 = "http://www.tools4movies.com/dvd_catalyst_profile_samples/Harold Kumar 3 Christmas bionic fast.mp4";
String links5 = "http://www.tools4movies.com/dvd_catalyst_profile_samples/The Amazing Spiderman bionic fast.mp4";
videoLinks.add(links1);
videoLinks.add(links2);
videoLinks.add(links3);
videoLinks.add(links4);
videoLinks.add(links5);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, videoLinks);
setListAdapter(adapter);
adapter.notifyDataSetChanged();
Bitmap bm = ThumbnailUtils.createVideoThumbnail(links1, Thumbnails.MICRO_KIND);
imageView.setImageBitmap(bm);
}
}