Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8721627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:15:07+00:00 2026-06-13T07:15:07+00:00

I am currently developing an app for android .. how i can capture the

  • 0

I am currently developing an app for android..

how i can capture the volume key event when user press in android phone

i am using phone gap…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:15:08+00:00Added an answer on June 13, 2026 at 7:15 am

    Use the below code to get the key event

    Use this code in your existing java class

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
    
        //If volume down key
        if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
            this.loadUrl("javascript:cordova.fireDocumentEvent('volumedownbutton');");
            return true;
        } else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
            this.loadUrl("javascript:cordova.fireDocumentEvent('volumeupbutton');");
            return true;
        } else {
            //return super.onKeyDown(keyCode, event); 
        }
        //return super.onKeyDown(keyCode, event);
    
        return true;
    }
    

    and using this below in your html page

    document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false);  
    
    document.addEventListener("volumedownbutton", volumedownbutton, false);
    
    function    onVolumeUpKeyDown()
    {
        alert("Working Up")     
    }
    
    function    volumedownbutton()
    {
        alert("Working Down")       
    }
    

    I Got This Answer From Here https://stackoverflow.com/questions/9770901/phonegap-event-volumeupbutton-and-volumedownbutton-is-not-working

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing an app which will be on Android Market. How can
i'm developing an app using google drive SDK currently on Android using eclipse, i
I'm currently developing an Android app, which loads events from a server using JSON
I'm currently developing my first game app for android OS using Processing. I need
I am currently developing an Android app that is using a remote MySQL database
I am currently developing an Android app that is supposed to inform the user
Currently I'm developing an Android app for that I'm using the Facebook SDK. It's
I am currently developing an Android-App in Eclipse and trying to use a Library
I am currently developing an android app, there is always unexpected exception popup when
I'm currently developing the presentation layer of an android app. The api which I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.