Guys I really need some help here!
On 8 juin, 16:10, Benjamin <[email protected]> wrote:
> Hi everyone!
> I've been developing for Android for three months now, and for the
> first time I'm working with the new 1.5 SDK.
>
> I'm facing a pretty basic problem with the WebView.
> I'm following the HelloWebView tutorial
> (here:http://developer.android.com/guide/tutorials/views/hello-webview.html)
> and when I'm launching my Activity, the page opens on the browser and
> not in my app!
>
> I tried everything, but I don't have a clue of the reason. Anyone
> faced the problem and knows how to solve it?
>
> Here's my code:
> -----------------------------------------------------------------------
> HelloWebView Manifest
> -----------------------------------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
> package="com.android.app.HelloWebView"
> android:versionCode="1"
> android:versionName="1.0">
> <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" />
> <uses-permission android:name="android.permission.INTERNET" />
> </manifest>
> -----------------------------------------------------------------------
>
> -----------------------------------------------------------------------
> 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>
> -----------------------------------------------------------------------
>
> -----------------------------------------------------------------------
> HelloWebView.java
> -----------------------------------------------------------------------
> package com.android.app.HelloWebView;
>
> import android.app.Activity;
> import android.os.Bundle;
> import android.webkit.WebView;
> import android.webkit.WebViewClient;
>
> 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");
> }}
>
> -----------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---