Redid everything from scratch. Still a blank, dark dark screen.
(Except for the hello, Webview on the top)
I would really appreciate any ideas.
Code is below.
Thank you.
-Mike
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) {
WebView webview;
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://www.yahoo.com");
}
}
On Wed, Jul 1, 2009 at 9:12 PM, Mark Murphy<[email protected]> wrote:
>
> Michael Dorin wrote:
>> Tonight's experimenting lead me to the hello-webview tutorial.
>>
>> http://developer.android.com/guide/tutorials/views/hello-webview.html
>>
>> I can't get that darn thing to work! I just get a blank screen.
>> I have seen a few comments such as this posted, but I can't follow
>> through to a solution.
>>
>> Thank you for your help.
>>
>> Mike
>>
>> Here is my layout: (main.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>
>>
>>
>> Here is my manifest:
>> <?xml version="1.0" encoding="utf-8"?>
>> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
>> package="com.edi.hellowebview"
>> android:versionCode="1"
>> android:versionName="1.0">
>>
>> <uses-permission android:name="android.permission.INTERNET" />
>>
>> <application android:icon="@drawable/icon"
>> android:label="@string/app_name">
>> <activity android:name=".HelloWebView"
>> android:label="@string/app_name">
>> <intent-filter>
>> <action android:name="android.intent.action.MAIN" />
>> <category android:name="android.intent.category.LAUNCHER" />
>> </intent-filter>
>> </activity>
>> </application>
>> <uses-sdk android:minSdkVersion="3" />
>> </manifest>
>>
>>
>> Here is my code:
>> package com.edi.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);
>> WebView webview ;
>> setContentView(R.layout.main);
>> webview = (WebView) findViewById(R.id.webview);
>> webview.getSettings().setJavaScriptEnabled(true);
>> webview.loadUrl("www.yahoo.com");
>>
>> }
>> }
>
> Try adding the http:// scheme on your URL.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://twitter.com/commonsguy
>
> Android Development Wiki: http://wiki.andmob.org
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---