です)ネットワークから、私はそのコードをした:無効化が要求されるギャラリーに奇妙なアニメーション、それはこれは私が私が非同期(一部の回これは来ることができ、画像をロードしたいImageViews(ページの親指)</p> <p>を表示した上で、私のギャラリーのアダプタである子供
public View getView(int position, View convertView, ViewGroup parent) {
final ImageView image = convertView != null ? convertView : new ImageView(getContext());
final PageInfo page = getItem(position);
image.setBackgroundColor(Color.WHITE);
image.setLayoutParams(new Gallery.LayoutParams(96, 170));
new AsyncTask<Void, Void, Bitmap>() {
@Override
protected Bitmap doInBackground(Void... arg0) {
try {
File thumbnail = page.thumbnail();//Thumbnail download the image if not available
return BitmapFactory.decodeStream(new FileInputStream(thumbnail));
} catch (ApplicationException e) {
return null;
} catch (NetworkException e) {
return null;
}
}
protected void onPostExecute(Bitmap result) {
if (result == null)
return;
image.setImageBitmap(result);
};
}.executeOnExecutor(executor);
return image;
}
これは動作しますが、私はギャラリービューを(実際のビットマップへの切り替え時)にドラッグしていた場合、ギャレー内の別の位置に「ジャンプ」を行います、それは変だ。
どうすれば避けることができますか?または、ViewGroupのレイアウトを要求せずにImageViewのイメージを変更できますか?
EDIT:Googleのdevのグループで同様の質問 http://code.google.com/p/android/issues/detail?id=15526
に配置されます。この問題はビューのリサイクルに関する問題ではなく、ASyncの読み込みとギャラリー内のビューを無効にするメソッドへの呼び出しです。 –