Code example for ProgressBar

Methods: setProgresssetVisibility, getVisibility

0
		public void setPB(ProgressBar mPB){
			pb = mPB;
		} 
		 
		public void onProgressChanged(WebView view, int progress){
			if(progress < 100 && pb.getVisibility() == ProgressBar.GONE){
	        	pb.setVisibility(ProgressBar.VISIBLE);
	        } 
	         
	        pb.setProgress(progress);
	         
	        if(progress == 100) {
	        	pb.setVisibility(ProgressBar.GONE);
	        	((BrowserActivity)getActivity()).updateRefreshStatus(false); 
				shouldUpdate = true;
				stop_btn.setVisibility(View.GONE);
	        } 
	        else if (shouldUpdate){
				((BrowserActivity)getActivity()).updateRefreshStatus(true); 
				shouldUpdate = false;
				stop_btn.setVisibility(View.VISIBLE);