@Override public void onPageStarted(WebView view, String url, Bitmap favicon) { // TODO Auto-generated method stub // 手機程式可以在標題列顯示橫式進度列 // 平板電腦只能顯示環狀等待迴圈 // mActivity.setProgressBarVisibility(true); mActivity.setProgressBarIndeterminateVisibility(true); mActivity.setTitle("正在下載網頁..."); mBtnReload.setEnabled(false); mBtnStop.setEnabled(true); super.onPageStarted(view, url, favicon); }
@Override protected void onPostExecute(Boolean result) { ((Activity) context).setProgressBarIndeterminateVisibility(false); int status; if (result == false) { this.handleError(); return; } try { status = request.status(); } catch (Exception e1) { e1.printStackTrace(); this.error_message = INTERNAL_ERROR_MESSAGE; this.handleError(); return; } if (status == 200) { } else if (status == 401) { this.error_message = ACCESS_DENIED_MESSAGE; this.handleError(); return; } else { this.error_message = INVALID_DATA_MESSAGE; this.handleError(); return; } this.handleSuccess(); }
public final void setActionBarLoadingIndicatorVisible(boolean visible) { isLoading = visible; if (reloadMenuItem != null) { reloadMenuItem.setActionView(visible ? loadingIndicator : null); } else { super.setProgressBarIndeterminateVisibility(visible); } }
@Override public void onPageFinished(WebView view, String url) { // TODO Auto-generated method stub // 平板電腦程式 - 隱藏環狀等待迴圈 mActivity.setProgressBarIndeterminateVisibility(false); mActivity.setTitle(R.string.app_name); mBtnReload.setEnabled(true); mBtnStop.setEnabled(false); if (mWebView.canGoBack()) mBtnGoBack.setEnabled(true); else mBtnGoBack.setEnabled(false); if (mWebView.canGoForward()) mBtnGoForward.setEnabled(true); else mBtnGoForward.setEnabled(false); super.onPageFinished(view, url); }
/** Start ConversationList query. */ public final void startMsgListQuery() { // Cancel any pending queries queryHandler.cancelOperation(MESSAGE_LIST_QUERY_TOKEN); try { // Kick off the new query activity.setProgressBarIndeterminateVisibility(Boolean.TRUE); queryHandler.startQuery( MESSAGE_LIST_QUERY_TOKEN, null, Conversation.URI_SIMPLE, Conversation.PROJECTION_SIMPLE, null, null, SORT); } catch (SQLiteException e) { Log.e(TAG, "error starting query", e); } }
@Override protected void onPreExecute() { ((Activity) context).setProgressBarIndeterminateVisibility(true); }