@Override public boolean onOptionsItemSelected(MenuItem item) { ImageDisplayer displayer = null; switch (item.getItemId()) { case 1: displayer = new ImageLoader.DefaultImageDisplayer(getResources().getDrawable(drawable.icon)); break; case 2: displayer = new ImageLoader.DisplayShow(); break; case 3: displayer = new MyDisplayer(); break; } loader.startLoading( new LoadContext<String, ImageView, Bitmap>( "http://imgsrc.baidu.com/forum/pic/item/98052e976e39082654fb963f.jpg", imageView), displayer); return super.onOptionsItemSelected(item); }
@Override protected void onDestroy() { super.onDestroy(); loader.destroy(false); }