0
votes

I have an error: "The markup in the document following the root element must be well-formed." I tried many things but nothing works.

<?xml version="1.0" encoding="utf-8"?>    
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webview"
    android:layout_width="fill_parent"
    android:layout_height="match_parent" />    
<ProgressBar 
     android:id="@+id/progressbar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    style="?android:ottr/progressBarStyleHorizontal"/>
1

1 Answers

0
votes

The error says Wrap it up into a parent layout.

see below :

   <?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"
                  android:weightSum="1"
                  android:orientation="vertical">       
    <WebView 
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="0.9"/>    
    <ProgressBar 
         android:id="@+id/progressbar"
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_weight="0.1"         
        style="?android:attr/progressBarStyleHorizontal"/>
    </LinearLayout>

view should be child of ViewGroup (i.e Layout). On Layout every view gets rendered.