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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:34:48+00:00 2026-05-28T07:34:48+00:00

xml <?xml version=1.0 encoding=utf-8?> <WebView xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/myWebView android:layout_width=wrap_content android:layout_height=wrap_content /> java public void onCreate(Bundle

  • 0

xml

<?xml version="1.0" encoding="utf-8"?>
<WebView
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:id="@+id/myWebView"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content" />

java

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.webview);
  WebView webView = (WebView) findViewById(R.id.myWebView);  
  webView.getSettings().setJavaScriptEnabled(true);
     webView.loadUrl("http://www.google.com");
 }

tabview xml

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost" android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout android:orientation="vertical"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:padding="5dp">
        <TabWidget android:id="@android:id/tabs"
            android:layout_width="fill_parent" android:layout_height="wrap_content" />
        <FrameLayout android:id="@android:id/tabcontent"
            android:layout_width="fill_parent" android:layout_height="fill_parent"
            android:padding="5dp" />
    </LinearLayout>
</TabHost>

Tabview java

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tabview);

        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost(); // The activity TabHost
        TabHost.TabSpec spec; // Resusable TabSpec for each tab
        Intent intent; // Reusable Intent for each tab


        intent = new Intent().setClass(this, WebActivity.class);
        spec = tabHost.newTabSpec("webview")
                .setIndicator("webview", res.getDrawable(R.drawable.info))
                .setContent(intent);
        tabHost.addTab(spec);

                // add other tabs

        tabHost.setCurrentTab(0);
    }

This will launch a webView in full screen.

Is it possible to display webview inside the tabview?

  • 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-28T07:34:49+00:00Added an answer on May 28, 2026 at 7:34 am

    You can find the answer here: http://developer.android.com/guide/webapps/webview.html#HandlingNavigation

    By default WebView launches the browser everytime you visit a new URL, so what happens is, it launches the browser.

    To avoid this happening everytime you click something etc, you need to add a WebViewClient to your WebView:

    WebView myWebView = (WebView) findViewById(R.id.webview);
    myWebView.setWebViewClient(new WebViewClient());
    myWebView.loadUrl("http://www.example.com");
    

    If you need to peform some particular action when a user clicks a link, implement your own WebViewClient:

    public class MyWebViewClient extends WebViewClient {
    
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            boolean result = false;
    
            /* ... */
            // Return false to proceed loading page, true to interrupt loading
    
            return result;
        }
    }
    

    And use it:

    myWebView.setWebViewClient(new MyWebViewClient());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my XML: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content> <WebView android:id=@+id/WebView01 android:layout_width=wrap_content android:layout_height=wrap_content
I've got the following layout: <?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=wrap_content android:orientation=vertical> <WebView
I have the following layout in place <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent
i am doing a application with this main.xml layout : <?xml version=1.0 encoding=utf-8?><LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have an XML file that looks like <?xml version='1.0' encoding='UTF-8'?> <root> <node name=foo1
I am trying to parse the following XML with javascript: <?xml version='1.0' encoding='UTF-8'?> <ResultSet>
I created an App.config file in my WPF application: <?xml version="1.0" encoding="utf-8" ?> <configuration>
I've an XML object converted into the following JSON object {?xml:{@version:1.0,@encoding:utf-8},Response:{Users:null,Messages:{Tell:{Notify:{@From:abc,@Message:hi system, its abc<br/>}},Group:null},PersistedMessages:{Tell:null,Group:null}}}
xml version 1.0 encoding utf-8 in php, I have tried : echo '<?xml version=1.0
I've created a WebView-based application according to http://developer.android.com/resources/tutorials/views/hello-webview.html Although I did exactly what was

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.