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));
}
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/");
}
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();
}
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);
}
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);
}
Aggregations