K
kabummski
Fortgeschrittenes Mitglied
- 18
Hallo ich nochmal.
Ich will jetzt die HelloWebView App Programmieren, doch er meckert bei "R.id.webview"
Habe schon einige Dinge ausprobiert, wahrscheinlich ist die Lösung auch ganz Leicht, doch ich komme nicht drauf -.-
HelloWebView.java
main.xml
R.java
Warum kann ich nicht auf die R.java und somit auf "id" zugreifen?
Hier die fehlermeldung;
DANKE IM VORRAUS
Ich will jetzt die HelloWebView App Programmieren, doch er meckert bei "R.id.webview"
Habe schon einige Dinge ausprobiert, wahrscheinlich ist die Lösung auch ganz Leicht, doch ich komme nicht drauf -.-
HelloWebView.java
package com.example.hellowebview;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import com.example.hellowebview.R;
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");
}
}
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
androidrientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<WebView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
/>
</LinearLayout>
R.java
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.example.hellowebview;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}
Warum kann ich nicht auf die R.java und somit auf "id" zugreifen?
Hier die fehlermeldung;
id cannot be resolved or is not a field
DANKE IM VORRAUS