1. Are you ready for the Galaxy S20? Here is everything we know so far!

Webbrowser

Discussion in 'Android Development' started by gracy, Sep 12, 2011.

  1. gracy

    gracy Newbie
    Thread Starter

    Here is my program.
    Code (Text):
    1.  
    2. public class webkit extends Activity {
    3.     /** Called when the activity is first created. */
    4.     WebView browser;
    5.     @Override
    6.     public void onCreate(Bundle savedInstanceState) {
    7.         super.onCreate(savedInstanceState);
    8.         setContentView(R.layout.main);
    9.         browser=(WebView) findViewById(R.id.webkit);
    10.         browser.loadUrl("http://www.dramacrazy.net");
    11.        // browser.loadUrl("http://localhost/Third" );
    12.        
    13.     }
    14. }
    15.  
    Code (Text):
    1.  
    2. <?xml version="1.0" encoding="utf-8"?>
    3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    4.     android:orientation="vertical"
    5.     android:layout_width="fill_parent"
    6.     android:layout_height="fill_parent"
    7.     >
    8. <WebView  
    9.     android:id="@+id/webkit"
    10.     android:layout_width="fill_parent"
    11.     android:layout_height="fill_parent"
    12.    
    13.     />
    14. </LinearLayout>
    15.  
    I have also add the following line the manifest.xml
    <uses-permission android:name="android.permission.INTERNET" />

    But the program shows only blank for every url.

    What is the problem?

    No, after a very long time, "web page not available" message is shown on the emulator.
    But I can access the Internet from my laptop.
    What is the problem?
     


Share This Page

Loading...