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

  • Home
  • SEARCH
  • 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 9183203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:44:42+00:00 2026-06-17T18:44:42+00:00

My WebView doesn’t show anything. It is just empty. <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical

  • 0

My WebView doesn’t show anything. It is just empty.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <WebView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />

  <!--   <LinearLayout
        android:id="@+id/tableRow"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/buttonAccept"
            android:layout_width="0sp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/button_accept" />

        <Button
            android:id="@+id/buttonDeny"
            android:layout_width="0sp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/button_deny" />
    </LinearLayout> -->

</LinearLayout>

This is the Activity:

public class TermsOfUseDialogActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.terms_menu_dialog);

        WebView webview = (WebView) findViewById(R.id.webview);
//      WebView webview = new WebView(this);
//      setContentView(webview);

        String htmlCode = "<html><body>WebView Test<br /><br />New Line Test</body></html>";
        // webview.loadDataWithBaseURL(null, htmlCode, "text/html", "UTF-8", null);

//      webview.clearView();
        webview.loadData(htmlCode, "text/html", "UTF-8");
//      webview.reload();

        // webview.loadUrl("http://www.google.at");
    }
}

As you can see I commented some code out. None if these tries worked except this part…

WebView webview = new WebView(this);
setContentView(webview);

In this case, I see the content but I can’t use this, because I need to use buttons shown in the XML above, too. Any ideas why this doesn’t show any content?

(Internet permissions are set in AndroidManifest)

  • 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-17T18:44:44+00:00Added an answer on June 17, 2026 at 6:44 pm

    I found the solution. The layout was incorrect. With the following layout, I’ve got a full screen web view with 2 buttons below:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
      <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/buttonRow"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_alignParentBottom="true">
    
            <Button
                android:id="@+id/buttonAccept"
                android:layout_width="0sp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/button_accept" />
    
            <Button
                android:id="@+id/buttonDeny"
                android:layout_width="0sp"
                android:layout_height="wrap_content"
                android:text="@string/button_deny"
                android:layout_weight="1" />
      </LinearLayout>
    
        <WebView
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/webview"
            android:layout_above="@+id/buttonRow"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />
    
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my WebView I'm loading YouTube official website: http://m.youtube.com/index?desktop_uri=%2F&gl=US#/ I want the user to
If I load www.youtube.com url on a webview and select any video, doesn't trigger
Does anyone knows an alternative to Android's webview component ? For some reasons, it's
webview in android loads more than once while loading the url. Below is the
My webview will works for a site such as Google.com, however, the specific page
It doesn't appear that the Source property for the XAML WebView control is updating
I am creating a webview app for iPad, and want to show a splashscreen
I have an application with just a visible WebView component to it which is
I have a WebView that just displays an image from the external SD-card. This
I'd like to start a WebView from my AsyncTask but it doesn't seem to

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.