Hello, I've never used java but for my science project I'm controlling
my robot with an android phone. For the video feed I want to embed a
webpage in the app to view the webcam feed. so I have created a
webview following the tutorial on the android dev website and right
now I just want to see google. Yet when I start it I don't see
anything other than the grey bar with the title and a black screen.
Science fair is in less then a week so a timely response would be
nice. I'm developing for android 1.6
Code in java file:
package com.example.HelloWebView;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class HelloWebView extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView webview;
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://www.google.com");
}
}
~~~~~~~~~~~~*****************~~~~~~~~~~~~~~~~
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
Thank you very much in advance,
Matt
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en