Code example for ProgressDialog

Methods: setIndeterminatesetMessagesetProgressStyle, setCancelable, show

0
        public void onPageStarted (WebView view, String url, Bitmap  favicon )
        { 
        	if ( mProgressDlg == null || !mProgressDlg.isShowing() )
        	{ 
        		InitProgressDlg(); 
        		mProgressDlg.show();
        	} 
        	super.onPageStarted( view, url, favicon );
        	 
        } 
        @Override 
        public void onPageFinished ( WebView view, String url )
        { 
        	super.onPageFinished( view, url );
        	if ( mProgressDlg != null )
        	{ 
        		mProgressDlg.dismiss();
        		mProgressDlg = null;
        	} 
        	// Remove from memory. Leave on the disk 
        	clearCache( false );
        } 
         
        private void InitProgressDlg() 
        { 
        	mProgressDlg = new ProgressDialog( mContext, android.R.style.Theme_Translucent_NoTitleBar );
        	mProgressDlg.setProgressStyle( ProgressDialog.STYLE_SPINNER );
        	mProgressDlg.setIndeterminate( true );
        	mProgressDlg.setCancelable( true );
        	mProgressDlg.setMessage( new String( "Loading...") ); 
        } 
    } 
     
    /************************************************************************************************* 
     *================================= Data members section =================================