protected void showLoadingPage() { if (mLoadDialogView == null) { GDLoadingDialogView.Builder builder = new GDLoadingDialogView.Builder(this, R.layout.no_network_error_view); mLoadDialogView = builder.create(); mLoadDialogView.ShowDialog(); } else { if (!mLoadDialogView.isShowing()) mLoadDialogView.ShowDialog(); } mLoadDialogView.showLoadingInfo(); mLoadDialogView.setCancelable(true); }
public void showErrorMsg(String error) { mHandler.removeCallbacks(mTimeoutTask); mHandler.removeCallbacks(mNoResponseTask); if (mLoadDialogView == null) showLoadingPage(); if (!mLoadDialogView.isShowing()) mLoadDialogView.ShowDialog(); mLoadDialogView.showLoadErrorInfo(error); if (mPageContent != null && mPageContent.getVisibility() == View.VISIBLE) { mHandler.postDelayed( new Runnable() { @Override public void run() { hideloadingPage(); } }, 1000); } else { mLoadDialogView.setCancelable(true); } }
private void handCanNotConnectToServer() { mHandler.removeCallbacks(mTimeoutTask); mHandler.removeCallbacks(mNoResponseTask); if (mLoadDialogView != null) { mLoadDialogView.showNetWorkErrorInfo(); mLoadDialogView.setCancelable(true); } if (mPageContent != null && mPageContent.getVisibility() == View.VISIBLE) { mHandler.postDelayed( new Runnable() { @Override public void run() { hideloadingPage(); } }, 1000); } }
@Override public void run() { if (mLoadDialogView != null && mLoadDialogView.isShowing()) handCanNotConnectToServer(); }
protected void onStop() { super.onStop(); if (mLoadDialogView != null) mLoadDialogView.dismiss(); };
protected void hideloadingPage() { mHandler.removeCallbacks(mNoResponseTask); if (mLoadDialogView != null && mLoadDialogView.isShowing()) { mLoadDialogView.hideDialog(); } }