It would be a good start to learn how to make blocks logical first. What does “audioNumber” mean? volume level? then it would be more logical to assign the name Volume or another, but understandable one.
Keep in mind that volume levels may have different maximum values on different devices.
for example, it happens up to 10. as a rule, it is 15. but I’ve seen 100, 150, and 200…
But here is the same extension with the changed things VolumeChanger.aix (5.3 KB)
Make sure that the maximum is 15
If you count your volume 0 precent to hundered precent volume up, the volume that you have been pressed to 100 precent volume is 15 times so whenever to 95 or 90, try to put the audioNumber to 14.
probably again The maximum value depends on the device.
it is enough to get its value in the code. :
int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
it is enough to request music. because the rest of the streams will be similar.