2011-07-17 26 views
0

首先,对不起我的英文不好! 我是新来的,我是Android应用开发者的初学者!和我有一个问题:Android:“忽略错误日志中的未知'WebView'XML元素”消息

它的main.xml:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <TextView 
     android:id= "@+id/txtv"  
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/hello"/> 
    <WebView 
     android:id="@+id/webv" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"/> 
    <LinearLayout 
     android:orientation="horizontal" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
     <Button 
      android:id = "@+id/backButton" 
      android:text="@string/bText" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"/> 
     <Button 
      android:id = "@+id/forwardButton" 
      android:text="@string/fText" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"/> 
     > 
    </LinearLayout> 
    > 
</LinearLayout> 

但是当我调试我的应用程序将在错误日志窗口中显示此错误:

AndroidManifest: Ignoring unknown 'WebView' XML element 

编辑:问题解决,上面的代码被修改和正确的代码!

+0

您是否想要在webview上加载html数据或者您想要在webview上加载url? – Sumant

+0

@Sumant - 没有什么与INTERNET权限相关的,如果你认为缺少... – evilone

+0

@Sumat - 我想在webview的资产文件夹中加载html页面。 –

回答

0

移除的WebView xmlns:android="http://schemas.android.com/apk/res/android"的这部分代码并添加android:layout_widthandroid:layout_height属性的按钮。

+0

非常感谢。我做到了,但结果相同!任何其他帮助! –

+0

编辑我的答案 – evilone

+0

@ evilone:不需要android.webkit.WebView在xml文件中WebView标记将出现 – Sumant