fix a crash at getting -1th element of an array
This commit is contained in:
parent
4d60ba741d
commit
baf6c36bcd
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue