public int update(PurgeableBitmap.RefreshHandler handler) { try { mBitmapArray[mDecodingCount] = BitmapFactory.decodeByteArray( bitstream, 0, bitstream.length, mOptions); mBitmap = mBitmapArray[mDecodingCount]; mDecodingCount++; if (mDecodingCount < mArraySize) { handler.sleep(delay); return 0; } else { return -mDecodingCount; } } catch (OutOfMemoryError error) { for (int i = 0; i < mDecodingCount; i++) { mBitmapArray[i].recycle(); } return mDecodingCount + 1; } }
public int update(PurgeableBitmap.RefreshHandler handler) { try { mBitmapArray[mDecodingCount] = BitmapFactory.decodeByteArray( bitstream, 0, bitstream.length, mOptions); mBitmap = mBitmapArray[mDecodingCount]; mDecodingCount++; if (mDecodingCount < mArraySize) { handler.sleep(delay); return 0; } else { return -mDecodingCount; } } catch (OutOfMemoryError error) { for (int i = 0; i < mDecodingCount; i++) { mBitmapArray[i].recycle(); } return mDecodingCount + 1; } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mView = new PurgeableBitmapView(this, detectIfPurgeableRequest()); mRedrawHandler.sleep(0); setContentView(mView); }
public void sleep(long delayMillis) { this.removeMessages(0); sendMessageDelayed(obtainMessage(0), delayMillis); } }
public void sleep(long delayMillis) { this.removeMessages(0); sendMessageDelayed(obtainMessage(0), delayMillis); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mView = new PurgeableBitmapView(this, detectIfPurgeableRequest()); mRedrawHandler.sleep(0); setContentView(mView); }