Class ShadowAlertDialog

    • Constructor Detail

      • ShadowAlertDialog

        public ShadowAlertDialog()
    • Method Detail

      • getLatestAlertDialog

        public static android.app.AlertDialog getLatestAlertDialog()
        Returns:
        the most recently created AlertDialog, or null if none has been created during this test run
      • getCustomView

        public android.widget.FrameLayout getCustomView()
      • reset

        public static void reset()
        Resets the tracking of the most recently created AlertDialog
      • clickOnItem

        public void clickOnItem​(int index)
        Simulates a click on the Dialog item indicated by index. Handles both multi- and single-choice dialogs, tracks which items are currently checked and calls listeners appropriately.
        Parameters:
        index - the index of the item to click on
      • getItems

        public java.lang.CharSequence[] getItems()
        Returns:
        the items that are available to be clicked on
      • getAdapter

        public android.widget.Adapter getAdapter()
      • getMessage

        public java.lang.CharSequence getMessage()
        Returns:
        the message displayed in the dialog
      • getView

        public android.view.View getView()
        Returns:
        the view set with AlertDialog.Builder.setView(View)
      • getIconId

        public int getIconId()
        Returns:
        the icon set with AlertDialog.Builder.setIcon(int)
      • getCustomTitleView

        public android.view.View getCustomTitleView()
        Returns:
        return the view set with AlertDialog.Builder.setCustomTitle(View)