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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:18:40+00:00 2026-06-18T17:18:40+00:00

I need to create a menu which opens a webview page or a simple

  • 0

I need to create a menu which opens a webview page or a simple page with images slide.

I’m more proficient in web programming, not so much in programming for Android. So if it is easier to do it in a WebView I will use it. I will use the images slide otherwise.

So for now, I need 2 items when I press the menu button of the phone. Upon clicking they should open 2 different links in the app (not in the browser).

I’ve done only menu.xml for now:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/menu_howto" android:title="@string/howto"
          android:icon="@android:drawable/ic_menu_howto" />

    <item android:id="@+id/menu_about" android:title="@string/about"
          android:icon="@android:drawable/ic_menu_info" />
</menu>
  • 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-18T17:18:42+00:00Added an answer on June 18, 2026 at 5:18 pm

    in your main class you must @override the menu like:-

        @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    

    and then to make the menu buttons clickable you have to add this after

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.exit:
                finish();
             return true;
            case R.id.loadanotherwebpage:
    loadUrl("www.google.com"); 
    // inside the menu button you don't need to call Super.loadUrl, LoadUrl its enough 
                return true;
            case R.id.share:
                share(); // here i'm calling the share method !
            default:
                return super.onOptionsItemSelected(item);
        }
    }
    

    edit : if you want to load the html file from assets file then do this

            super.loadUrl("file:///android_asset/index.html");
    

    hope that what you asking for 🙂

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

Sidebar

Related Questions

I need to create a simple app which can display geometries from Oracle Spatial
I need to create a menu component in which each menu item looks like
Hi I am new to wicket framework, I need to create a context menu
I need to create HTML pop-up menu using Perl. Can anyone help me?
I'm trying to create a vertical menu and I need to make a multicolumn
I need create clone repository. but I do not know where can I get
I need to create a dropdown menu, or combobox, for a Windows Forms application
I need to create a control which has a single permanent tab (home), and
So I've come across the following problem. I need to create a dinamic menu
I need to customize as to which portlet appear in the Add more portlet

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.