You can override the default function for the Dialogue and assure nothing happens. Should work fine.
@Override
public boolean onTouchEvent(MotionEvent event) {
// If we've received a touch notification that the user has touched
// outside the app, finish the activity.
if (MotionEvent.ACTION_OUTSIDE == event.getAction()) {
// Do Something or not...
return true;
}
return false;
}
Or for better practice:
builder.setCanceledOnTouchOutside(false)