fix a problem when there are no files to play
finish the activity when dismissing the dialog