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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:25:46+00:00 2026-06-10T03:25:46+00:00

How would one go about enabling the ActionBar in a webview. My current code

  • 0

How would one go about enabling the ActionBar in a webview. My current code goes straight to loading the page in a web browser and skips all of my other activity logic, but I’m not sure why.

Main Activity

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.webview);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setTitle("My Page");
    actionBar.setDisplayShowHomeEnabled(false);

    WebView myWebView = (WebView) findViewById(R.id.webview);
    myWebView.loadUrl(http://www.google.com);
}

XML File

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

<WebView
    android:id="@+id/webview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginTop="5dip"
/>

</LinearLayout>

I have also tried creating a dialog to show the webview, but that also proved unsuccessful.
Thanks!

  • 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-10T03:25:47+00:00Added an answer on June 10, 2026 at 3:25 am

    Alright, so I found the answer to my problem, but it was more of a technicality than anything.

    The problem was that the link was a redirect page, so the built in web-browser app was hijacking my session, adding this into my onCreate method solved it.

    Thanks for the replies though!

    myWebView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                return false;
            }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would one go about loading compiled C code at run time, and then
How exactly would one go about getting an OpenGL app to run fullscreen straight
I would like to know how one goes about adding functionality from one open
How would one go about detecting a page refresh / F5 key push on
How would one go about getting his or her code 'validated' to ensure it
Hello How would one go about reverse engineering a page such as the this
How would one go about either using the 3D components of WPF or using
How would one go about proving to management that a batch reformat of all
How would one go about defining something like this in an xsd? <start> <request
How would one go about writing a query that selects items 2000-2010 out of

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.