quantum6 / Android-USB-OTG-Camera

Apache License 2.0
109 stars 33 forks source link

Targeting sdk 31 and above #13

Closed dgjinovci closed 12 months ago

dgjinovci commented 1 year ago

If targeting sdk 31 and above, PendingIntent will cause IllegalArgumentException if last flag is not set

At: libusbcamera/src/main/java/com/serenegiant/usb/USBMonitor.java line 181

quantum6 commented 1 year ago

Is SDK 31 is android 13? My phone is android 11.

dgjinovci commented 1 year ago

It's android 12

Pending intent has changed for android 12/sdk 31 and up

https://stackoverflow.com/questions/71689781/android-app-crashes-when-targeting-to-android-12

Changes: https://developer.android.com/reference/android/app/PendingIntent?hl=en#FLAG_MUTABLE

quantum6 commented 12 months ago

Thanks, I modified code. Good luck!