android-webview

WebView throws InflateException on android 5.0 [duplicate]

狂风中的少年 提交于 2019-12-24 18:13:25
问题 This question already has answers here : android.view.InflateException Error inflating class android.webkit.WebView (11 answers) Closed last month . After upgrading to "androidx.appcompat:appcompat:1.0.2" and "com.google.android.material:material:1.1.0-beta01" the WebView crashes on devices with Android 5.0 and throws this exeption android.view.InflateException Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class android.webkit.WebView How can I fix it? 回答1

Implement “Copy Link Text” feature in the app

两盒软妹~` 提交于 2019-12-24 18:09:04
问题 I have Android WebView which displays search results. Using the contextMenu and WebView HitTestResult , I have successfully implemented a list of options like open, save, copy link url. Now, I would like to implement copy link text feature as present in Google chrome android which should copy only link text (title). A similar(not exact) feature is present in default Android browser as "Select text" option. I don't want the code for copying text using clipboard instead my main motto is to

Implement “Copy Link Text” feature in the app

房东的猫 提交于 2019-12-24 18:08:05
问题 I have Android WebView which displays search results. Using the contextMenu and WebView HitTestResult , I have successfully implemented a list of options like open, save, copy link url. Now, I would like to implement copy link text feature as present in Google chrome android which should copy only link text (title). A similar(not exact) feature is present in default Android browser as "Select text" option. I don't want the code for copying text using clipboard instead my main motto is to

Android 2.2 webview not supporting Tamil font

柔情痞子 提交于 2019-12-24 17:10:04
问题 i am developing new android application...i tried load html content in webview in 2.2 emulator but not supporting tamil font here my code... WebView learn2crack = (WebView)findViewById(R.id.webview); learn2crack.getSettings().setDefaultTextEncodingName("utf-8"); learn2crack.getSettings().setJavaScriptEnabled(true); learn2crack.loadUrl("http://www.dinamalar.com/"); thanks in advance 回答1: Try this link Tamil fonts in Android https://github.com/mayooresan/Japs-Attack-Ceylon--Android-App 回答2:

set/get Data in webview android

我只是一个虾纸丫 提交于 2019-12-24 16:54:27
问题 I have this webview: <textarea name="text" id="textPage" class="text_area"></textarea> <script language="javascript" charset="utf-8"> //call some method of javascript. </script> Is it possible to set text to textarea and get text from textarea. Set/get data from id(if any method possible) will be appreciated. 回答1: After many research i found solution, it might useful in future: Set Data: Android: webView.loadUrl("javascript:setData()"); JS: function setData(){ //js code } Get Data: Android:

save webpages for offline browsing

Deadly 提交于 2019-12-24 12:51:17
问题 i am trying to create an android application that saves webpages to use it in offline-browsing , i was able to save the webpage but the problem was in the contents (images, javascripts,..etc), is there a way to do so programmatically , i use eclipse and test my work on an emulator. 回答1: hm, I am afraid you should parse html's yourself (I mean do that with a properly lib) and store all resources (css, js, images, videos etc.) too. s. how it is done in a java crawler: open source crawlers 回答2:

Solving Rendering Artifacts in Frame Buffer with WebView and EditText on Android 5.0?

会有一股神秘感。 提交于 2019-12-24 12:08:03
问题 After upgrading Nexus 5 to Android 5.0, an activity with default focus on an EditText does not render correctly (EditText repeats down across the screen with grey dots in between and if you click again or dump the ViewHierarchy with UiAutomator, it will return to normal rendering). (I would upload the image, but don't yet have reputation for images). NOTE: This is ONLY after I have loaded a WebView within the application (though in a separate activity). The same screen renders correctly prior

Android Webview Handling Orientation Not Working

时光总嘲笑我的痴心妄想 提交于 2019-12-24 10:48:12
问题 Im using webview and I want to stop reloading the page when orientation changes. I have the following in my activity: @Override public void onConfigurationChanged(Configuration config) { super.onConfigurationChanged(config); } @Override protected void onSaveInstanceState(Bundle outState ){ ((WebView) findViewById(R.id.webView)).saveState(outState); } And in my layout, I have: <WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent" android

Android WebView text zoom for different screens and os version

不羁的心 提交于 2019-12-24 10:47:48
问题 Good morning guys, I've an app that is designed to work both on smartphone and tablet. When it runs on tablet I want to zoom the text of my webview to allow users to read better the text and to fill all the empty space if it's possible. This the code that I'm using to do that trick: //Webview Zoom if( UIUtils.isTablet(getActivity())) { if(UIUtils.isICS()) { webView.getSettings().setTextZoom(130); } else { int currentTextSizeIndex = lyricsView.getSettings().getTextSize().ordinal(); if (

Can I make Android WebView support other image formats (e.g. TIFF)?

拜拜、爱过 提交于 2019-12-24 10:47:11
问题 For example, how to make the following HTML page actually display the image, in an Android WebView? <html> <body> <img src="http://www.alternatiff.com/sample.tif"> </body> </html> Any (hacking) suggestion is appreciated. I am only an app developer and cannot control the whole system, so modifying the OS source code is not applicable. 回答1: I haven't tried this, but this is what I would do: Make a subclass of WebViewClient Override shouldInterceptRequest() to check the URL and see if a TIFF was