android-webview

How to create/update/load a HTML file at runtime

半世苍凉 提交于 2020-01-20 08:30:15
问题 I need to create and open an HTML file at runtime. <html> <body> <form name="Home" method="POST" action='' > <input id='Title' type='hidden' value="Mr" name='Title'/> <input id='Name' type='hidden' value="bala" name='Name'/> . . . </form> <script language='javascript'> //java script </script> </body> </html> In above format, i need to update value field at runtime. After updating I want to open this html file within my android application. Update: I know we can crate HTML file like below..

How to create/update/load a HTML file at runtime

蓝咒 提交于 2020-01-20 08:29:03
问题 I need to create and open an HTML file at runtime. <html> <body> <form name="Home" method="POST" action='' > <input id='Title' type='hidden' value="Mr" name='Title'/> <input id='Name' type='hidden' value="bala" name='Name'/> . . . </form> <script language='javascript'> //java script </script> </body> </html> In above format, i need to update value field at runtime. After updating I want to open this html file within my android application. Update: I know we can crate HTML file like below..

Android WebView not loading URL

不问归期 提交于 2020-01-19 07:10:18
问题 I want to load the URL in WebView I have used the following Code: webView = (WebView) findViewById(R.id.webview1); webView.setWebViewClient(new HostsWebClient()); webView.getSettings().setPluginState(PluginState.ON); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setSupportMultipleWindows(false); webView.getSettings().setSupportZoom(false); webView

Android WebView not loading URL

谁都会走 提交于 2020-01-19 07:06:33
问题 I want to load the URL in WebView I have used the following Code: webView = (WebView) findViewById(R.id.webview1); webView.setWebViewClient(new HostsWebClient()); webView.getSettings().setPluginState(PluginState.ON); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setSupportMultipleWindows(false); webView.getSettings().setSupportZoom(false); webView

Android WebView not loading URL

时光总嘲笑我的痴心妄想 提交于 2020-01-19 07:04:06
问题 I want to load the URL in WebView I have used the following Code: webView = (WebView) findViewById(R.id.webview1); webView.setWebViewClient(new HostsWebClient()); webView.getSettings().setPluginState(PluginState.ON); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setSupportMultipleWindows(false); webView.getSettings().setSupportZoom(false); webView

[Android]How to load swf file in Android (API 23)

余生长醉 提交于 2020-01-17 13:57:29
问题 I want to load swf file in Android , but it seems that Android don't support swf. I google it,and most of developers suggest to use webview: WebSettings settings = webview.getSettings(); settings.setPluginsEnabled(true); webView.getSettings().setPluginState(WebSettings.PluginState.ON); webView.loadurl("....swf"); but setPluginsEnabled was removed and setPluginState is deprecated in Api level 23. 回答1: "but it seems that Android don't support swf" Yes and as you've been told... Adobe stopped

Can I overlap the WebView with an ImageButton?

我只是一个虾纸丫 提交于 2020-01-17 07:35:51
问题 What I want to create should look like this : I want it like this because I want the button to cover a part of the content of the webview making it unreachable for the user. 回答1: You can do it using FrameLayout as follows... <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <Button android

Android Webview has extra white space at the bottom

為{幸葍}努か 提交于 2020-01-16 05:30:09
问题 I'm using the following method with HTML to load a local image into webview void loadingImage(WebView mWebView){ mWebView.getSettings().setSupportZoom(false); mWebView.getSettings().setDisplayZoomControls(false); String mHead="<html><head><style type='text/css'>body{margin:auto auto;text-align:center;} img{width:100%25;} </style></head>"; String mBody = "<body> <img src='my_image.jpg'/> </body></html>"; mWebView.loadDataWithBaseURL("file:///android_res/drawable/", mHead + mBody, "text/html",

Android - Characters such as å,ä,ö do not render correctly in WebView

青春壹個敷衍的年華 提交于 2020-01-15 12:02:53
问题 I am using the following code to render my webview in android - webview.loadDataWithBaseURL(null, "Subject: "+ getSubject() +" Content: "+ getContent() , "text/html" , "UTF-8", ""); The subject and content that I receive from the server are UTF encoded and show wrongly as Ã¥,ä,ö in the log and on screen. However in iOS webview they show up correctly as å,ä,ö. How do I get them to show as å,ä,ö in android as well? 回答1: make sure the content you recieve, in tag <head> use like this: <meta

Implement Swipe function in WebView and call a Javascript Function via a Javascript Interface

六眼飞鱼酱① 提交于 2020-01-15 10:22:25
问题 I want to implement Swipe Features in my WebView App and call functions in the Javascript of the HTML/Javascript App when a swipe is made. According to the answer of this problem: How to detect a swipe gesture on webview I made something like this: package (...); import (...) public class MainActivity extends Activity { WebView mywebview; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mywebview = (WebView)