fix a crash at getting -1th element of an array

This commit is contained in:
tibbi 2017-03-30 22:02:25 +02:00
parent 4d60ba741d
commit baf6c36bcd
1 changed files with 1 additions and 0 deletions

View File

@ -33,6 +33,7 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo
private fun setupPhotoResolutionPicker(view: View) {
val items = getFormattedResolutions(camera.parameters.supportedPictureSizes)
var selectionIndex = if (isBackCamera) config.backPhotoResIndex else config.frontPhotoResIndex
selectionIndex = Math.max(selectionIndex, 0)
view.change_resolution_photo_holder.setOnClickListener {
RadioGroupDialog(activity, items, selectionIndex) {