android.app.AlertDialog.hide()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中android.app.AlertDialog.hide()方法的一些代码示例,展示了AlertDialog.hide()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AlertDialog.hide()方法的具体详情如下:
包路径:android.app.AlertDialog
类名称:AlertDialog
方法名:hide

AlertDialog.hide介绍

暂无

代码示例

代码示例来源:origin: codepath/intro_android_demo

public void onClick(DialogInterface dialog, int which) {
    alertDialog.hide();
  }
});

代码示例来源:origin: zfman/hputimetable

@Override
public void hide() {
  if(alertDialog!=null) alertDialog.hide();
}

代码示例来源:origin: stackoverflow.com

AlertDialog alertDialog = new AlertDialog.Builder(Main.this).create();
...
alertDialog.show();
int valueIamWaitingFor = 5;
if (aValue == valueIamWaitingFor){
  alertDialog.hide();
}

代码示例来源:origin: linkasu/linkatype-android

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  mDatabaseManager.setCategory(position, selected);
  loadStatements();
  mainDialog.hide();
}

代码示例来源:origin: IvanVolosyuk/diskusage

public void run() {
  try {
   debugDataSource = debugDataSourceBridge.loadDefaultDump();
   debugLoadedDump = true;
   DataSource.override(debugDataSource);
   dialog.hide();
   MountPoint.reset();
   makeDialog();
  } catch (IOException e) {
   Log.d("diskusage", "Failed to enable debug", e);
   Toast.makeText(
     SelectActivity.this,
     "Failed to enable debug " + e.getMessage(),
     Toast.LENGTH_LONG).show();
  }
 }
}

代码示例来源:origin: IvanVolosyuk/diskusage

public void run() {
  try {
   debugLoadedDump = false;
   debugDataSource = debugDataSourceBridge.initNewDump(SelectActivity.this);
   DataSource.override(debugDataSource);
   dialog.hide();
   MountPoint.reset();
   makeDialog();
  } catch (IOException e) {
   Log.d("diskusage", "Failed to enable debug", e);
   Toast.makeText(
     SelectActivity.this,
     "Failed to enable debug " + e.getMessage(),
     Toast.LENGTH_LONG).show();
  }
 }
}

代码示例来源:origin: IvanVolosyuk/diskusage

@Override
 public void run() {
  boolean reload = false;
  try {
   BufferedReader reader = DataSource.get().getProcReader();
   String line;
   int checksum = 0;
   while ((line = reader.readLine()) != null) {
    checksum += line.length();
   }
   reader.close();
   if (checksum != RootMountPoint.checksum) {
     Log.d("diskusage", checksum + " vs " + RootMountPoint.checksum);
    reload = true;
   }
  } catch (Throwable t) {}
  if (reload) {
   dialog.hide();
   MountPoint.reset();
   makeDialog();
  }
  handler.postDelayed(this, 2000);
 }
};

代码示例来源:origin: linkasu/linkatype-android

mainDialog.hide();
  break;
case 2:

代码示例来源:origin: IvanVolosyuk/diskusage

@Override
  public void run() {
    DataSource.override(new DefaultDataSource());
    debugDataSource = null;
//        debugUnhidden = false;
    dialog.hide();
    MountPoint.reset();
    makeDialog();
  }

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

@Test
public void coverActivity() {
  /* Pause/resume should not alter dialog. */
  Distribute.getInstance().onActivityPaused(mFirstActivity);
  Distribute.getInstance().onActivityResumed(mFirstActivity);
  /* Only once check, and no hiding. */
  verify(mDialog).show();
  verify(mDialog, never()).hide();
  verify(mUnknownSourcesDialog).show();
  verify(mUnknownSourcesDialog, never()).hide();
  /* Cover activity. Second dialog must be replaced. First one skipped. */
  Distribute.getInstance().onActivityPaused(mFirstActivity);
  Distribute.getInstance().onActivityResumed(mock(Activity.class));
  verify(mDialog).show();
  verify(mDialog, never()).hide();
  verify(mUnknownSourcesDialog, times(2)).show();
  verify(mUnknownSourcesDialog).hide();
}

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

@Test
public void clickSettingsGoBackWithoutEnabling() throws Exception {
  /* Click settings. */
  Intent intent = mock(Intent.class);
  whenNew(Intent.class).withArguments(Settings.ACTION_SECURITY_SETTINGS).thenReturn(intent);
  ArgumentCaptor<DialogInterface.OnClickListener> clickListener = ArgumentCaptor.forClass(DialogInterface.OnClickListener.class);
  verify(mDialogBuilder).setPositiveButton(eq(R.string.appcenter_distribute_unknown_sources_dialog_settings), clickListener.capture());
  clickListener.getValue().onClick(mUnknownSourcesDialog, DialogInterface.BUTTON_POSITIVE);
  when(mUnknownSourcesDialog.isShowing()).thenReturn(false);
  /* Verify navigation. */
  verify(mFirstActivity).startActivity(intent);
  /* Simulate we go back and forth to settings without changing the value. */
  Distribute.getInstance().onActivityPaused(mFirstActivity);
  Distribute.getInstance().onActivityResumed(mFirstActivity);
  /* Second dialog will be back directly, no update dialog again. */
  verify(mDialog).show();
  verify(mDialog, never()).hide();
  verify(mUnknownSourcesDialog, times(2)).show();
  verify(mUnknownSourcesDialog, never()).hide();
}

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

@Test
@PrepareForTest(AsyncTaskUtils.class)
public void clickSettingsThenEnableThenBack() throws Exception {
  /* Click settings. */
  Intent intent = mock(Intent.class);
  whenNew(Intent.class).withArguments(Settings.ACTION_SECURITY_SETTINGS).thenReturn(intent);
  ArgumentCaptor<DialogInterface.OnClickListener> clickListener = ArgumentCaptor.forClass(DialogInterface.OnClickListener.class);
  verify(mDialogBuilder).setPositiveButton(eq(R.string.appcenter_distribute_unknown_sources_dialog_settings), clickListener.capture());
  clickListener.getValue().onClick(mUnknownSourcesDialog, DialogInterface.BUTTON_POSITIVE);
  when(mUnknownSourcesDialog.isShowing()).thenReturn(false);
  /* Verify navigation. */
  verify(mFirstActivity).startActivity(intent);
  /* Simulate we go to settings, change value then go back. */
  mockStatic(AsyncTaskUtils.class);
  Distribute.getInstance().onActivityPaused(mFirstActivity);
  when(InstallerUtils.isUnknownSourcesEnabled(mContext)).thenReturn(true);
  Distribute.getInstance().onActivityResumed(mFirstActivity);
  /* No more dialog, start download. */
  verify(mDialog).show();
  verify(mDialog, never()).hide();
  verify(mUnknownSourcesDialog).show();
  verify(mUnknownSourcesDialog, never()).hide();
  verifyStatic();
  AsyncTaskUtils.execute(anyString(), argThat(new ArgumentMatcher<AsyncTask<Object, ?, ?>>() {
    @Override
    public boolean matches(Object argument) {
      return argument instanceof DownloadTask;
    }
  }), anyVararg());
}

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

order.verify(mDialog).hide();
order.verify(mDialog).show();
order.verifyNoMoreInteractions();
verify(mDialog).hide();

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

return null;
}).when(mUnknownSourcesDialog).hide();

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

verify(mDialog, never()).hide();
verify(mDialogBuilder, times(2)).create();
verify(mDialog, times(2)).show();
verify(mDialog).hide();

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

return null;
}).when(mDialog).hide();

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

return null;
}).when(mDialog).hide();

相关文章