Search in sources :

Example 41 with WebSettings

use of android.webkit.WebSettings in project K6nele by Kaljurand.

the class FormDemoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    WebView webview = new WebView(this);
    setContentView(webview);
    WebSettings webSettings = webview.getSettings();
    webSettings.setJavaScriptEnabled(true);
    // addJavascriptInterface has security issues below API 17
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        webview.addJavascriptInterface(new WebAppInterface(this), "Android");
    }
    webview.loadUrl(getString(R.string.fileFormDemo));
}
Also used : WebSettings(android.webkit.WebSettings) WebView(android.webkit.WebView)

Example 42 with WebSettings

use of android.webkit.WebSettings in project aware-client by denzilferreira.

the class About method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.aware_about);
    WebView about_us = (WebView) findViewById(R.id.about_us);
    WebSettings settings = about_us.getSettings();
    settings.setJavaScriptEnabled(true);
    about_us.loadUrl("http://www.awareframework.com/team/");
}
Also used : WebSettings(android.webkit.WebSettings) WebView(android.webkit.WebView)

Example 43 with WebSettings

use of android.webkit.WebSettings in project SmartCampus by Vegen.

the class ArticleDetailActivity method setupUI.

// Tencent mTencent;
@Override
protected void setupUI() {
    // mTencent = Tencent.createInstance("1106797634", this.getApplicationContext());
    // baseUiListener = new BaseUiListener();
    // mTencent.login(this, "", baseUiListener);
    newsTitle = getIntent().getStringExtra("newsTitle");
    newsUrl = getIntent().getStringExtra("newsUrl");
    setTitle(newsTitle);
    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    // 设置自适应屏幕,两者合用
    // 将图片调整到适合webview的大小
    webSettings.setUseWideViewPort(true);
    // 缩放至屏幕的大小
    webSettings.setLoadWithOverviewMode(true);
    // 支持自动加载图片
    webSettings.setLoadsImagesAutomatically(true);
    // 设置编码格式
    webSettings.setDefaultTextEncodingName("utf-8");
    webSettings.setSupportZoom(true);
    webSettings.setTextSize(WebSettings.TextSize.LARGEST);
    refreshLayout.setEnableLoadmore(false);
    refreshLayout.startRefresh();
}
Also used : WebSettings(android.webkit.WebSettings)

Example 44 with WebSettings

use of android.webkit.WebSettings in project androidquery by androidquery.

the class WebDialog method setupWebView.

private void setupWebView(RelativeLayout layout) {
    wv = new WebView(getContext());
    wv.setVerticalScrollBarEnabled(false);
    wv.setHorizontalScrollBarEnabled(false);
    if (client == null)
        client = new WebViewClient();
    wv.setWebViewClient(new DialogWebViewClient());
    WebSettings ws = wv.getSettings();
    ws.setJavaScriptEnabled(true);
    //ws.setSaveFormData(false);
    //wv.loadUrl(url);
    RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
    layout.addView(wv, lp);
}
Also used : WebSettings(android.webkit.WebSettings) RelativeLayout(android.widget.RelativeLayout) WebView(android.webkit.WebView) WebViewClient(android.webkit.WebViewClient)

Example 45 with WebSettings

use of android.webkit.WebSettings in project xabber-android by redsolution.

the class PatreonAppealActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_patreon_appeal);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setTitle(R.string.patreon_title);
    toolbar.inflateMenu(R.menu.toolbar_patreon_activity);
    toolbar.setOnMenuItemClickListener(this);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NavUtils.navigateUpFromSameTask(PatreonAppealActivity.this);
        }
    });
    WebView webView = (WebView) findViewById(R.id.webView);
    webView.loadUrl(getString(R.string.patreon_appeal_url));
    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
}
Also used : WebSettings(android.webkit.WebSettings) WebView(android.webkit.WebView) View(android.view.View) WebView(android.webkit.WebView) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

WebSettings (android.webkit.WebSettings)92 WebView (android.webkit.WebView)49 WebViewClient (android.webkit.WebViewClient)29 SuppressLint (android.annotation.SuppressLint)23 View (android.view.View)17 WebChromeClient (android.webkit.WebChromeClient)17 Intent (android.content.Intent)10 JsResult (android.webkit.JsResult)7 Bitmap (android.graphics.Bitmap)6 KeyEvent (android.view.KeyEvent)6 WebResourceRequest (android.webkit.WebResourceRequest)6 NetworkCallback (android.net.ConnectivityManager.NetworkCallback)5 Network (android.net.Network)5 NetworkCapabilities (android.net.NetworkCapabilities)5 NetworkRequest (android.net.NetworkRequest)5 Bundle (android.os.Bundle)5 RelativeLayout (android.widget.RelativeLayout)5 TextView (android.widget.TextView)5 WebResourceError (android.webkit.WebResourceError)4 Activity (android.app.Activity)3