R.id cannot be resolved

Posted by Soren on Stack Overflow See other posts from Stack Overflow or by Soren
Published on 2010-03-20T16:04:57Z Indexed on 2010/03/20 16:11 UTC
Read the original article Hit count: 187

Filed under:
|
|

So I copied this tutorial example thing right from Google's android site and I ma getting an error that R.id cannot be resolved.

Here is my Java file

package com.TestApp.HelloWebView;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class HelloWebView extends Activity {
    WebView mWebView;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mWebView = (WebView) findViewById(R.id.webview);
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.loadUrl("http://www.google.com");
    }

}

Here is my main.xml

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

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

© Stack Overflow or respective owner

Related posts about android

Related posts about java