Volume button not working

I have made 4-5 Android apps with Corona, when running one of them the hardware volume buttons does not respond at all. No visible volume indicator and no volume change either.

What should I look for that has this strange effect on the volume buttons? This does not happen i any of my other apps.

The build.settings

settings = { --child tables here orientation =   { default = "portrait", supported = { "portrait" }, }, android =   { versionCode = "102", usesPermissions =     { "android.permission.INTERNET", "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.VIBRATE", }, usesFeatures = { { name = "android.hardware.location.gps", required = true }, }, }, }

config.lua

application = { content = { width = 800, height = 1300, scale = "zoomStretch", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, } }

The operating system should handle the volume keys for you unless you are intercepting the keys in your corona app using the onKeyEvent event.

If you’re using that, you need to make sure to not handle the volume keys (and return false) if you want the OS to handle it for you.

Rob

Specially for Android. Return false for other key-events which you do not wish to handle. If you just want to let the OS handle the volume buttons, add this :

 function keyListener( event , params ) local phase = event.phase local keyName = event.keyName if ( "back" == keyName and phase == "up" ) then -- Handle the 'back' button here during 'up' phase. end -- Let the OS handle the volume buttons if ( keyName == "volumeUp" ) then return false elseif ( keyName == "volumeDown" ) then return false end return false end

That should work, but for safety, I would take that if-then-elseif block out and just end with the return false.  The OS should be in control.

Rob

The operating system should handle the volume keys for you unless you are intercepting the keys in your corona app using the onKeyEvent event.

If you’re using that, you need to make sure to not handle the volume keys (and return false) if you want the OS to handle it for you.

Rob

Specially for Android. Return false for other key-events which you do not wish to handle. If you just want to let the OS handle the volume buttons, add this :

 function keyListener( event , params ) local phase = event.phase local keyName = event.keyName if ( "back" == keyName and phase == "up" ) then -- Handle the 'back' button here during 'up' phase. end -- Let the OS handle the volume buttons if ( keyName == "volumeUp" ) then return false elseif ( keyName == "volumeDown" ) then return false end return false end

That should work, but for safety, I would take that if-then-elseif block out and just end with the return false.  The OS should be in control.

Rob