Code example for View

Methods: getTagsetTag, getContext, setDrawingCacheEnabled

0
	 
	 
	 
	public void load(){ 
		 
		if(url.equals(wv.getTag(AQuery.TAG_URL))){
    		return; 
    	} 
		 
    	wv.setTag(AQuery.TAG_URL, url);
    	 
    	if(android.os.Build.VERSION.SDK_INT <= 10){
    		wv.setDrawingCacheEnabled(true);
    	} 
    	 
    	fixWebviewTip(wv.getContext());
		 
    	 
    	WebSettings ws = wv.getSettings();
    	ws.setSupportZoom(zoom);
    	ws.setBuiltInZoomControls(zoom);
    	 
    	if(!control){
    		disableZoomControl(wv);
    	} 
    	 
    	ws.setJavaScriptEnabled(true);
    	wv.setBackgroundColor(color);
    	 
    	if(progress != null){
    		//progress.setVisibility(View.VISIBLE); 
    		Common.showProgress(progress, url, true);
    	} 
    	 
		if(wv.getWidth() > 0){
			setup(); 
		}else{ 
			delaySetup(); 
		} 
		 
		 
		 
	} 
	 
	private void delaySetup(){ 
		 
		wv.setPictureListener(new PictureListener() {
			 
 
			@Override 
			public void onNewPicture(WebView view, Picture picture) {
				wv.setPictureListener(null);
				setup(); 
			} 
			 
			 
		}); 
		 
		//wv.setInitialScale(100); 
		wv.loadData("<html></html>", "text/html", "utf-8");
		wv.setBackgroundColor(color);
		 
	} 
	 
	 
    private void setup(){ 
    	 
    	String source = getSource(wv.getContext());
    	String html = source.replace("@src", url).replace("@color", Integer.toHexString(color));
    	 
    	wv.setWebViewClient(this);
    	 
    	//wv.setInitialScale(100); 
Stop searching for code, let great code find you!  Add Codota to your java IDE