public void showExitMessage() { if (!Utils.isDeviceOnline(mActivity)) { String title = "Error"; String message = "You're not connected!"; String positiveButton = "OK"; DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mActivity.finish(); } }; Utils.showMessage(mActivity, title, message, positiveButton, listener, null); } }
public boolean showRefreshDialog() { if (mDialog.isShowing()) { mDialog.dismiss(); } if (!Utils.isDeviceOnline(mActivity)) { mDialog.show(); return true; } else { return false; } }