I have been desperately searching throughout the internet of a semi-complete example of how to use this in Java. Nearly all the examples I can find are in Kotlin, eg
registerForActivityResult(GetContent()) { uri: Uri? ->
But I can't use that syntax in Java. The closest I've found is this: ActivityResultContracts.TakePicture(), but this isn't for the GetContent()
contract, it's for TakePicture()
and it's not working for me.
How can I register for the GetContent activity result using Java?
[edit] seems all my problems may have been solved by adding implementation 'androidx.appcompat:appcompat:1.3.1
and using the examples here