Code examples for Displaying web pages

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
				mContent.addView(mTitle); 
			} 
 
		private void setUpWebView() 
			{ 
				mWebView = new WebView(getContext()); 
				mWebView.setVerticalScrollBarEnabled(false); 
				mWebView.setHorizontalScrollBarEnabled(false); 
				mWebView.setWebViewClient(new FbDialog.FbWebViewClient()); 
				mWebView.getSettings().setJavaScriptEnabled(true); 
				mWebView.loadUrl(mUrl); 
				mWebView.setLayoutParams(FILL); 
				mContent.addView(mWebView); 
			} 
 
		private class FbWebViewClient extends WebViewClient 
			{ 
 
				@Override 
				public boolean shouldOverrideUrlLoading(WebView view, String url) 
Full Snippet Info
10
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
		super(activity); 
 
		this.setTitle("Changelog"); 
 
		 
		WebView 	view 	 = new WebView(activity); 
		WebSettings settings = view.getSettings();   
         
		settings.setJavaScriptEnabled(true);   
		settings.setAppCacheEnabled(false); 
         
		view.setWebViewClient( new WebViewClient() { 
			@Override 
			public void onPageStarted( WebView view, String url, Bitmap favicon ) { 
				if( mLoader == null ) 
					mLoader = ProgressDialog.show( activity, "", "Loading changelog ..." ); 
				 
				super.onPageStarted(view, url, favicon); 
			} 
 

10
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
	} 
	 
	/* Return Base64 Encoded String to Javascript */ 
	public void processPicture( String js_out ) 
	{		 
		mAppView.loadUrl("javascript:navigator.camera.win('" + js_out + "');");			 
	} 
	 
	public void failPicture(String err) 
	{ 
		mAppView.loadUrl("javascript:navigator.camera.fail('" + err + "');"); 
	} 
	 
} 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
    			byte buff[] = new byte[rawData.length]; 
    			in.read(buff, 0, buff.length); 
    			out.write(buff, 0, rawData.length); 
    			out.flush(); 
    			out.close();    			 
    			mView.loadUrl("javascript:navigator.file.winCallback('File written')"); 
    		} catch (Exception e) {  
    			mView.loadUrl("javascript:navigator.file.failCallback('Fail')");  
    		} 
		return 0; 
    } 
     
 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
    } 
            
  
	public void loadUrl(String url) 
	{ 
		appView.loadUrl(url); 
	} 
 
  /** 
    * Provides a hook for calling "alert" from javascript. Useful for 
    * debugging your javascript. 
  */ 
	public class GapClient extends WebChromeClient {				 
		 
		Context mCtx; 
		public GapClient(Context ctx) 
		{ 
			mCtx = ctx; 
		} 
		 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
     
  @Override 
  public void onCreate(Bundle icicle) { 
    super.onCreate(icicle); 
     
    browser=new WebView(this); 
    setContentView(browser); 
    browser.loadUrl(getIntent().getStringExtra(URL)); 
  }      
} 
 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
		@Override 
		public void onCreate(Bundle state) 
		{ 
			super.onCreate(state); 
 
			WebView view = new WebView(this); 
			view.getSettings().setJavaScriptEnabled(true); 
			view.loadUrl("file:///android_asset/about.html"); 
			view.setBackgroundColor(Color.TRANSPARENT); 
			setContentView(view); 
		} 
	} 
 
	@TargetApi(11) 
	public static class AboutFragment extends WebViewFragment { 
		@Override 
		public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 
		{ 
			WebView view = (WebView)super.onCreateView(inflater, container, savedInstanceState); 
			view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
 
 
	public void onSensorChanged(SensorEvent event) { 
		// We only care about the orientation as far as it refers to Magnetic North 
		float heading = event.values[0]; 
		mAppView.loadUrl("javascript:gotBearing(" + heading + ")"); 
	} 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
    private void setUpWebView() { 
    	CookieSyncManager.createInstance(getContext());  
        CookieManager cookieManager = CookieManager.getInstance(); 
        cookieManager.removeAllCookie(); 
         
        mWebView = new WebView(getContext()); 
         
        mWebView.setVerticalScrollBarEnabled(false); 
        mWebView.setHorizontalScrollBarEnabled(false); 
        mWebView.setWebViewClient(new TwitterWebViewClient()); 
        mWebView.getSettings().setJavaScriptEnabled(true); 
        mWebView.loadUrl(mUrl); 
        mWebView.setLayoutParams(FILL); 
         
        mContent.addView(mWebView); 
    } 
 
    private class TwitterWebViewClient extends WebViewClient { 
 
        @Override 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
      super.onCreate(savedInstanceState); 
 
      WebView wv=new WebView(getContext()); 
 
      wv.loadUrl("http://commonsware.com"); 
 
      setContentView(wv); 
    } 
  } 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE