결과화면  

로딩 진행 상태가 보이는가!!!!

 

 

로딩 완료!!! 

// WebViewDemoA2.java

 

package com.example.graphic;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class WebViewDemoA2 extends Activity {
 private WebView webview;

 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.webview_demo);
  
  webview = (WebView)this.findViewById(R.id.webview);
  
  webview.setWebViewClient(new WebViewClient(){

   @Override
   public void onPageFinished(WebView view, String url) {

    super.onPageFinished(view, url);
    setProgressBarIndeterminateVisibility(false);
   }

   @Override
   public void onPageStarted(WebView view, String url, Bitmap favicon) {
    super.onPageStarted(view, url, favicon);
    setProgressBarIndeterminateVisibility(true);
   }
   
  });
  
  
  webview.loadUrl("http://fs1025.mireene.com/");
 }
}

 

 

 

 

 

// webview_demo.xml

 

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <WebView
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>

 

 

 

<!-- 매니페스트에 권한 추가!!! -->

<uses-permission android:name="android.permission.INTERNET" />

+ Recent posts