@Override
  protected Dialog onCreateDialog(int id) {
    switch (id) {
      case DIALOG_ALERT:
        // Create out AlterDialog
        Builder builder = new AlertDialog.Builder(this);
        builder.setMessage("Personal data will be stored to improve the product.\n\nDo you agree?");
        builder.setCancelable(true);
        builder.setPositiveButton("I don't", new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
            RegisterUserActivity.this.finish();
          }
        });
        builder.setNegativeButton("I agree", null);
        AlertDialog dialog = builder.create();
        dialog.show();
    }
    return super.onCreateDialog(id);
  }
Demo project to verify NativeAndroidDriver actions.

@author ddary
selendroid-test-app/src/main/java/io/selendroid/testapp/RegisterUserActivity.java