WebView - ClassNotFoundException

-1

I'm creating the following screen in the

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/activities_fundo_cinza"
    android:orientation="vertical" >

<Webview
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

But I have the following error:

  

04-07 14: 55: 45.557: E / AndroidRuntime (1693): Caused by: java.lang.ClassNotFoundException: Did not find class "android.view.Webview" on path: DexPathList [[zip file] / data / app / br.test.apk "], nativeLibraryDirectories = [/ data / app-lib / br.livetouch.synchro-2, / system / lib]]

    
asked by anonymous 07.04.2014 / 17:20

1 answer

1

You need to rewrite Webview for WebView . So:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/activities_fundo_cinza"
    android:orientation="vertical" >

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

</LinearLayout>

The tag name is used to load the class so it has to be exactly the same name.

As described in documentation .

  

In general, in the XML vocabulary to declare elements of the interface follows the structure and naming conventions of classes and methods, where elements and element names match the class and attributes correspond to methods. In fact, the match is so straightforward that you can guess which attribute XML corresponds to which class method, or assume which class corresponds to which element a XML . However, note that not every vocabulary is identical. In some cases there is a slight naming difference. For example, the EditText element has a text attribute that corresponds to EditText.setText()

    
07.04.2014 / 17:20