public synchronized void update(int progress) { if (foreground) { browserController.updateProgress(progress); } setAlbumCover(ViewUnit.capture(this, dimen144dp, dimen108dp, false, Bitmap.Config.RGB_565)); if (isLoadFinish()) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); if (sp.getBoolean(context.getString(R.string.sp_scroll_bar), true)) { setHorizontalScrollBarEnabled(true); setVerticalScrollBarEnabled(true); } else { setHorizontalScrollBarEnabled(false); setVerticalScrollBarEnabled(false); } setScrollbarFadingEnabled(true); new Handler() .postDelayed( new Runnable() { @Override public void run() { setAlbumCover( ViewUnit.capture( NinjaWebView.this, dimen144dp, dimen108dp, false, Bitmap.Config.RGB_565)); } }, animTime); if (prepareRecord()) { RecordAction action = new RecordAction(context); action.open(true); action.addHistory(new Record(getTitle(), getUrl(), System.currentTimeMillis())); action.close(); browserController.updateAutoComplete(); } } }