}
public void notifyObservers() {
- for (int i = 0; i < mObservers.size(); i++) {
- ImageShow imageShow = mObservers.elementAt(i);
- imageShow.invalidate();
- imageShow.updateImage();
- }
+ mLoader.getActivity().runOnUiThread(mNotifyObserversRunnable);
}
+ private final Runnable mNotifyObserversRunnable = new Runnable() {
+ @Override
+ public void run() {
+ for (int i = 0; i < mObservers.size(); i++) {
+ ImageShow imageShow = mObservers.elementAt(i);
+ imageShow.invalidate();
+ imageShow.updateImage();
+ }
+ }
+ };
+
@Override
public void addObserver(ImageShow observer) {
if (!mObservers.contains(observer)) {
mHiresCache = new DelayedPresetCache(this, 3);
}
+ public FilterShowActivity getActivity() {
+ return mActivity;
+ }
+
public void loadBitmap(Uri uri,int size) {
mUri = uri;
mOrientation = getOrientation(mContext, uri);