本文整理匯總了Java中android.app.ProgressDialog.isShowing方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressDialog.isShowing方法的具體用法?Java ProgressDialog.isShowing怎麽用?Java ProgressDialog.isShowing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.app.ProgressDialog
的用法示例。
在下文中一共展示了ProgressDialog.isShowing方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupViewsForLogin
import android.app.ProgressDialog; //導入方法依賴的package包/類
private void setupViewsForLogin(boolean loading){
btnLogin.setEnabled(!loading);
if(loading) {
mDialog = new ProgressDialog(this);
mDialog.setIndeterminate(true);
mDialog.setMessage(getString(R.string.text_loading_login));
mDialog.show();
}else if(mDialog.isShowing()){
mDialog.dismiss();
}
}
示例2: showProgressDialog
import android.app.ProgressDialog; //導入方法依賴的package包/類
private void showProgressDialog(
@Nullable final String message,
final boolean cancelable,
@Nullable final DialogInterface.OnCancelListener cancelListener) {
final ProgressDialog prevDialog = dialogAtomicReference.getAndSet(null);
if (prevDialog != null && prevDialog.isShowing()) {
runOnUiThread(new Runnable() {
@Override
public void run() {
prevDialog.dismiss();
}
});
}
runOnUiThread(new Runnable() {
@Override
public void run() {
final ProgressDialog newDialog = ProgressDialog.show(
// Context
MainActivity.this,
// Title
null,
// Message
message,
// Indeterminate
true,
// Cancelable
cancelable,
// CancelListener
cancelListener
);
if (!dialogAtomicReference.compareAndSet(null, newDialog)) {
newDialog.dismiss();
}
}
});
}
示例3: dismissProgressDialogIfShowing
import android.app.ProgressDialog; //導入方法依賴的package包/類
private void dismissProgressDialogIfShowing() {
final ProgressDialog prevDialog = dialogAtomicReference.getAndSet(null);
if (prevDialog != null && prevDialog.isShowing()) {
runOnUiThread(new Runnable() {
@Override
public void run() {
prevDialog.dismiss();
}
});
}
}
示例4: dismiss
import android.app.ProgressDialog; //導入方法依賴的package包/類
public static void dismiss(ProgressDialog progress) {
if (progress != null && progress.isShowing()){
progress.dismiss();
}
}