Code example for WebView: Displaying web pages

Methods: getSettingsloadUrlsetPictureListener

0
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.item_web);
         
        webView = (WebView) findViewById(R.id.webView);
        webView.getSettings().setDefaultZoom(WebSettings.ZoomDensity.FAR);
 
        webView.loadUrl(getIntent().getExtras().getString(URL_PARAM));
         
        progress = ProgressDialog.show(this, "", "Loading...", true);
                 
        webView.setPictureListener(new WebPictureListener());
    } 
     
    class WebPictureListener implements PictureListener {
 
        @Override 
        public void onNewPicture(WebView view, Picture arg1) {
            ItemWeb.this.webView.setVisibility(View.VISIBLE);
            ItemWeb.this.progress.dismiss();             
        }