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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:25:18+00:00 2026-06-09T17:25:18+00:00

I am developing an android application and I need to display HTML page. I

  • 0

I am developing an android application and I need to display HTML page.

I managed to do this using the web view as below

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

    <WebView 
    android:id="@+id/webView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    </WebView>

    <Button
            android:id="@+id/disease_consultation_button"
            android:layout_width="@dimen/buttonWidth"
            android:layout_height="@dimen/buttonHeight"
            android:layout_gravity="right"
            android:layout_marginRight="20dp"
            style="@style/buttonStyle"
            android:text="@string/continue_button" />

    </LinearLayout>

and from java code

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

       webView = (WebView) findViewById(R.id.webView1);
       webView.getSettings().setJavaScriptEnabled(true);

       String customHtml = "<html><body><h1>Hello, WebView</h1></body></html>";
       webView.loadData(customHtml, "text/html", "UTF-8");

    }

the button doesn’t appear in the view and I don’t know why ?

can anyone help me please ?

the view looks like this

The view appearing

EDIT : This is what I did and solved the problem =)

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >    

     <TextView android:id="@+id/disease_consultation_titleTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            style="@style/activityTitle" />

    <Button
            android:id="@+id/disease_consultation_button"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/buttonHeight"
            android:layout_gravity="right"
            android:layout_marginLeft="550dp"
            android:layout_marginTop="80dp"
            style="@style/buttonStyle"
            android:text="@string/request_new_consultation" />

    <WebView 
            android:id="@+id/webView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="150dp" >

    </WebView>

</RelativeLayout>
  • 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-09T17:25:19+00:00Added an answer on June 9, 2026 at 5:25 pm

    One thing you can do is to place first button (or another layout to contain more than one items) and then add you WebView e.g.

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    
    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" />
    
    <WebView
        android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    </LinearLayout>
    

    Hope this helps…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an android mobile application using eclipse. I need a database that
I am developing an Android application using Phonegap . I need to make the
I am developing an Android application using Eclipse and APT. Now I need to
I am developing an android application(using Eclipse 3.5.2, Android 2.2) where i need to
I am developing an android application using IntelliJ IDEA 11.1.2 and I need datepicker
I am developing an android application and i need to read words from a
I'm developing android application for CAR usage and I need that in phone or
I am developing an android application in which I need to launch an Fragment
I started developing an Android application that record a video and I need to
I am developing an android application where in each activity i need to pass

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.