Hello Stack Overflow community,
I am currently working on an Android TV app using Jetpack Compose and am facing a problem that I can't seem to find a solution for.
In traditional Android development, I could easily use the AudioManager class to handle system sounds. However, with the transition to Jetpack Compose, I am not sure how to do the same.
Here is the typical approach that I would use in the traditional View system:
AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audioManager.playSoundEffect(Sounds.DISMISS);
How can I accomplish the equivalent in Jetpack Compose? Any assistance would be greatly appreciated. If any additional information is needed, I'm more than happy to provide it.
Thank you in advance.
(it didn't work:)
<resources>
<style name="Theme.xxx" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:soundEffectsEnabled">true</item>
</style>
</resources>