Sub Activity_KeyPress (KeyCode As Int) As Boolean
Dim PhoneVolume As Phone
If KeyCode = KeyCodes.KEYCODE_VOLUME_DOWN Then
If PhoneVolume.GetVolume(PhoneVolume.VOLUME_MUSIC) > 0 Then
PhoneVolume.SetVolume(PhoneVolume.VOLUME_MUSIC,PhoneVolume.GetVolume(PhoneVolume.VOLUME_MUSIC)-1,True)
End If
End If
If KeyCode = KeyCodes.KEYCODE_VOLUME_UP Then
If PhoneVolume.GetVolume(PhoneVolume.VOLUME_MUSIC) < PhoneVolume.GetMaxVolume(PhoneVolume.VOLUME_MUSIC) Then
PhoneVolume.SetVolume(PhoneVolume.VOLUME_MUSIC,PhoneVolume.GetVolume(PhoneVolume.VOLUME_MUSIC)+1,True)
End If
End If
End Sub