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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:36:25+00:00 2026-05-30T20:36:25+00:00

I got a tab menu using a ViewPager . Each tab contains fragments from

  • 0

I got a tab menu using a ViewPager. Each tab contains fragments from android.support.v4 package (compatibility with old SDKs). One of the fragment is a WebView (called FragmentWeb) and I want it to stay into the pager layout. The problem is when my WebView is inflated, it runs in fullscreen mode.

Is there a way to keep web browser under my tabs ?

Thank you

My Fragment Class : FragmentWeb.java

public class FragmentWeb extends Fragment {

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View mainView = (View) inflater.inflate(R.layout.fragment_web, container, false);
    WebView webView = (WebView) mainView.findViewById(R.id.webview);
    webView.loadUrl("http://www.google.com");
    return mainView;
}
}

My Fragment’s layout : fragment_web.xml

<?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" >

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

</LinearLayout>
  • 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-30T20:36:26+00:00Added an answer on May 30, 2026 at 8:36 pm

    This can be done by adding the following code to your onCreateView within your fragment code and embedding a WebViewClient call:

                    webview.setWebViewClient(new MyWebViewClient());
                webview.getSettings().setPluginsEnabled(true);
                webview.getSettings().setBuiltInZoomControls(false); 
                webview.getSettings().setSupportZoom(false);
                webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);   
                webview.getSettings().setAllowFileAccess(true); 
                webview.getSettings().setDomStorageEnabled(true);
                webview.loadUrl(mTabURL);       
            }
            return v;
        }
    
    
        public class MyWebViewClient extends WebViewClient {        
            /* (non-Java doc)
             * @see android.webkit.WebViewClient#shouldOverrideUrlLoading(android.webkit.WebView, java.lang.String)
             */
    
    
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                if (url.endsWith(".mp4")) 
                {
                    Intent intent = new Intent(Intent.ACTION_VIEW);
                    intent.setDataAndType(Uri.parse(url), "video/*");
    
                    view.getContext().startActivity(intent);
                    return true;
                } 
                else {
                    return super.shouldOverrideUrlLoading(view, url);
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my app, I've got 3 tabs. On clicking on each individual tab, some
I am using jquery for accordion menu, I have got a news box on
I've got simple tab activity with next layout: <TabWidget android:id=@android:id/tabs android:layout_width=fill_parent android:layout_height=wrap_content android:background=#ffffff00 />
I've got a simple application that opens a tab-delimited text file, and inserts that
Got a crash report from a beta tester and I'm having trouble identifying the
I've got a tab control, and when the user wants to add to it,
I've got a WPF tab control that contain several duplicate controls as Tab Page
I've got a link on the web page that causes new browser window (tab)
I have been working on this Tab View and I finally got it working
I've got a csv file I'm parsing with PHP. (Actually, it's tab-separated.) In a

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.