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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:13:51+00:00 2026-06-05T05:13:51+00:00

How I can show a webview in a tabwidget? When I open the tab,

  • 0

How I can show a webview in a tabwidget?
When I open the tab, the webview opens in other new page without opens in a tabcontent.
Where is the problem?

code activity.class :

public class layout1i2 extends Activity{
Button button1, button2;
WebView webview1, webview2;

      @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);  
    setContentView(R.layout.layout1);

          //declarar webvies i botó de tirar enrere       webview1 = (WebView) findViewById(R.id.webview1);       button1 = (Button)

findViewById(R.id.button1); button2 = (Button)
findViewById(R.id.button2);
webview1.loadUrl(“http://www.facebook.com”); webview1.setWebChromeClient(new WebChromeClient());

          button1.setOnClickListener(new OnClickListener()        {           @Override           public void onClick(View arg0)              {
          setContentView(R.layout.layout2);
          webview2 = (WebView) findViewById(R.id.webview2);
          button2 = (Button) findViewById(R.id.button2);
          button2.setOnClickListener(new OnClickListener() 
          {
              @Override
              public void onClick(View arg0) 
              {
                  setContentView(R.layout.layout1);
                  webview1 = (WebView) findViewById(R.id.webview1);       
              }
          });             }
});

}

layout2.xml

      <RelativeLayout
          android:id="@+id/Layout2"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" >

          <WebView
              android:id="@+id/webview2"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:autoLink="web"
              android:scrollbars="none"
              android:textColor="@android:color/black" />

          <Button
              android:id="@+id/button2"
              style="?android:attr/buttonStyleSmall"
              android:layout_width="60dp"
              android:layout_height="25dp"
              android:layout_below="@+id/webview2"
              android:layout_alignParentRight="true"
              android:layout_alignParentTop="true"
              android:layout_marginRight="35dp"
              android:layout_marginTop="19dp"
              android:text="Button2"
              android:textSize="14px" />

      </RelativeLayout>

layout1.xml

      <RelativeLayout
          android:id="@+id/Layout1"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" >

          <WebView
              android:id="@+id/webview1"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:autoLink="web"
              android:scrollbars="none"
              android:textColor="@android:color/black" />

          <Button
              android:id="@+id/button1"
              style="?android:attr/buttonStyleSmall"
              android:layout_width="60dp"
              android:layout_height="25dp"
              android:layout_below="@+id/webview2"
              android:layout_alignParentRight="true"
              android:layout_alignParentTop="true"
              android:layout_marginRight="35dp"
              android:layout_marginTop="19dp"
              android:text="Button1"
              android:textSize="14px" />

      </RelativeLayout>

Thank’s

  • 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-05T05:13:54+00:00Added an answer on June 5, 2026 at 5:13 am

    Use this line:

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

Sidebar

Related Questions

how can I show pictures in WebView without saving images into file system? I
How I can show only 2 posts on my websites first page? I am
I want to download a page and show this in WEBVIEW local, but the
I got the code for showing activity indicator in a webview. I checked more
I got some strange problem with my WebView. The problem is that I can't
I have a webview in which a local html page is show. It all
I'm using a webview on my activity. page is loaded from android_asset: webView.loadUrl(file:///android_asset/htm/main.htm); I
can anyone recommend a website crawler that can show me all of the links
if so can show simple example, ex in jquery ajax.post
I know that you can show current GPS moving location on map with WP7

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.