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

  • Home
  • SEARCH
  • 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 4250944
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:35:43+00:00 2026-05-21T04:35:43+00:00

im displaying web page content in webview and i want to disable the all

  • 0

im displaying web page content in webview and i want to disable the all 4 arrow key of android keyboard. any idea?

edit:

public boolean onKeyDown(int keyCode, KeyEvent event) {
    int a;
     Log.d("yourTag",""+event.getAction());
    System.out.println(a=event.getAction());
    System.out.println(keyCode);
      if(event.getAction()==20){
         return true;
      }
      else if(event.getAction()==21){
          return true;
      }
      else if(event.getAction()==22){
          return true;
      }
      else{
              return true;
      }

    }

scrolling still there but back key and menu key is disabled why? i noticed it returns nothing if content is scrolling. once scrolling ends it(log.d message) returns 0.

  • 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-05-21T04:35:44+00:00Added an answer on May 21, 2026 at 4:35 am

    You can catch them in an onkeydown?

    public boolean onKeyDown(int keyCode, KeyEvent event) {
      if(event.getAction() == /*INSERT YOUR KEY*/){
        //do something with the arrows. or ignore them
        //return true or false depending on if you want to "catch" the event i guess
      }else{
          return super.onKeyDown(keyCode, event);
      }
    }
    

    You’d only have to find the code for the arrow-keys, that shouldn’t be to hard. You could even just Log.d your event.getAction(), and press them, to find out what they’re called…

    I don’t really know what you are doing with your debugcode, but check out this link: http://developer.android.com/reference/android/view/KeyEvent.html for the key events. The events are integers. Why don’t you add this for debugging:

    public boolean onKeyDown(int keyCode, KeyEvent event) {
        Log.d("yourTag",""+event.getAction());
    }
    

    and see what’s returned? My guess would be one of the DPAD keys, for instance left ( 21 ) are your target

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

Sidebar

Related Questions

My web page has two ways of displaying a particular content. 1. When the
I want to display the content of an XML file in a web page
I have a webview that displaying authenticated web page. I need to save the
I'm displaying a small Google map on a web page using the Google Maps
I have a Spring 3.0.x web project that is displaying a page of links
I'm displaying images from outside my web root, like this: header('Content-type:image/png'); readfile($fullpath); The content-type:
i am displaying a webpage in the webview . im adding some more content
For displaying hyperlink on a page on my android app I am doing this:
I have went through all the posts on displaying local images on android phone.
On a php web page, i'm displaying an html5 player which plays an mp3

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.