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 6334987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:46:02+00:00 2026-05-24T18:46:02+00:00

I’ve spent weeks designing a custom webview, for an app I am building. I

  • 0

I’ve spent weeks designing a custom webview, for an app I am building. I have a class (let’s call it myWebView) that extends the android WebView. I declared myWebView in my main.xml, just as you would any other UI elements accept i prepended myWebView with the package name. Everything worked fine and dandy.

After weeks of getting all the functionality on my extended class working it came time to implement an options menu. Compared with what I had been doing I thought this would be a relatively simple task. I overwrote onCreateOptionsMenu(), and tried to inflate my menu from an xml file. When I ran my app in the emulator and pressed the menu button, nothing happened. My code for onCreateOptionsMenu() wasn’t flawed. I tried it in a dummy activity that had a simple main.xml that only contained a regular webview. The menu worked in the dummy activity. I then tried the various other ways to populate a menu (using the different implementations of menu.add()), and they all worked my dummy activity but they didn’t work in my actual app. I deleted everything from my activity except for what was in onCreate and onCreateOptionsMenu, to see if anything from one my other methods was interfering with the menu creation. That also accomplished nothing. I put a log statement into onCreateOptionsMenu() to see if the method was even being called. Lo-and-behold it wasn’t being called when i pushed the menu button. Finally I went into my main.xml and deleted the tag for myWebView from the layout. After doing that the app ran and menu worked.

So for some reason, using my custom web view prevents menu’s from working. Has anyone else encountered this problem? I find it hard to believe that you can’t use options menus with custom ui elements, so there must be some work around. Conversely, has anyone built a custom webview and implemented an options menu successfully, which would mean that i have to go and re-examine my code. I’ll put my code up if anyone thinks it will help, but I am 99.99% positive that everything is coded correctly and according to best practices, and the code for my extended class is massive and would require a great deal of scrubbing. Based on what I have said here though, does anyone have any ideas?

  • 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-24T18:46:02+00:00Added an answer on May 24, 2026 at 6:46 pm

    I just figured it out actually. I override keypad events to do nothing and that’s what was preventing it from occurring. apparently it’s a pretty common error that people make. I must have just not hit that magic combination of search terms for google before. thank you for ur offer of help though. I hope my mistake will help you in android journeys

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.