Skip to content

Commit

Permalink
Merge pull request google-ai-edge#37 from googlesamples/issue_36_gest…
Browse files Browse the repository at this point in the history
…ure_rec_lateinit_not_initialized

Adding exception catch to adapter that runs before helper is finished…
  • Loading branch information
PaulTR committed Jan 18, 2023
2 parents 4e16cdd + 7d3d22e commit 445a7da
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,13 @@ class CameraFragment : Fragment(),
override fun onItemSelected(
p0: AdapterView<*>?, p1: View?, p2: Int, p3: Long
) {
gestureRecognizerHelper.currentDelegate = p2
updateControlsUi()
try {
gestureRecognizerHelper.currentDelegate = p2
updateControlsUi()
} catch(e: UninitializedPropertyAccessException) {
Log.e(TAG, "GestureRecognizerHelper has not been initialized yet.")

}
}

override fun onNothingSelected(p0: AdapterView<*>?) {
Expand Down

0 comments on commit 445a7da

Please sign in to comment.