android-webview

The WebView running in the emulator in Android studio cannot access internet, but Chrome can?

匆匆过客 提交于 2019-12-22 09:13:25
问题 I installed Android studio 1.0.1 and followed this page https://developer.chrome.com/multidevice/webview/gettingstarted to wrap a website to an app. However, I got the following error when running it in emulator. Webpage not available The webpage at https://..... could not be loaded because: net::ERR_NAME_NOT_RESOLVED However, I tried to click the link and it launched the website in Chrome without any problem. 回答1: This may sound kind of obvious, but make sure 3G is turned on in your emulator

How can I bind an HTML string to a webview in an Android app?

与世无争的帅哥 提交于 2019-12-22 09:10:17
问题 I currently have a android:TextView which is bound to a string which may or may not contain HTML. <TextView android:text="Medium Text" android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="fill_parent" android:layout_height="wrap_content" android:autoLink="all" android:padding="10dp" style="@style/ListItemText" local:MvxBind="Text Answer" /> Somehow I need to be able to display this text with the html rendered. So I thought I would switch the TextView to a WebView

Java nullpointer exception from Webview in android.webkit.WebViewClassic.loadDataWithBaseURL

纵饮孤独 提交于 2019-12-22 08:00:01
问题 Following the suggestions provided in this question I modified my AdMob code to be compliant with the recommendations, that effectively worked reducing the number of exceptions that were appearing. However a new exception is rising. The code is the following: @Override protected void onDestroy() { if ( adView != null ) { adView.destroy(); adView = null; Log.i(ApplicationData.APP_TAG, TAG + ": OnDestroy, destroying the Adview"); } super.onDestroy(); } The method adView.destroy() appears to

Playing an app local video (.mp4) in a webview

陌路散爱 提交于 2019-12-22 05:42:31
问题 I have an app that I'm writing for both iOS and Android. I have a content page with which I need to link to/play a .mp4 video in a UIWebView/WebView. The video is going to be included in the app so that it can work offline. With iOS I just used a video tag (with source to a project file) and then used NSNotifications to fullscreen and landscape the video (app normally runs in portrait mode). Job done. On Android I'm having some issues. Firstly, when you use a local image as the video poster

Make Web push notification work using webview in a native android app?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 04:04:03
问题 I have a website which is responsive and push notification feature enabled. In my native android app, if i load my website in a WebView , then the pop up which usually comes in chrome/firefox to ask if user wants to allow push notification or not, doesn't shows up in WebView . And obviously the WebView won't support the same web push notification for the app. I know how to implement GCM or FCM in app to enable mobile push, but i wanted to know if it possible just to club the web push

Android window doesn't resize/pan when softinput opened from WebView

≯℡__Kan透↙ 提交于 2019-12-22 01:33:15
问题 My problem is following. Application uses theme android:Theme.NoTitleBar.Fullscreen and there is only one Activity , all other views are Fragment I have WebView inside ViewPager Fragment which is inside ScrollView HTML content has input fields I click input field which is on bottom of WebView Soft input opens, but the Window is not resized/panned I've tried setting android:windowSoftInputMode="adjustResize" or android:windowSoftInputMode="adjustPan" in my manifest for the Activity . Also

Android WebView throws SQLiteException

爱⌒轻易说出口 提交于 2019-12-22 01:05:32
问题 I am getting crash reports from sporadic SQLiteException s in my application. I am not directly interacting with SQLite databases at all. I have tracked the code down to the usage of the WebView widget. The exceptions differ in cause, but a couple of examples are as follows... android.database.sqlite.SQLiteException: database is locked: BEGIN EXCLUSIVE; at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method) at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java

Android WebView and network-security-configuration

落爺英雄遲暮 提交于 2019-12-22 00:29:51
问题 I'm developing on Android 8 (26 API, Oreo) and I use android.webkit.WebView in my app. I would implement "secure network connection" when I load pages with my WebView (in other words I would avoid man-in-the-middle problems and self-signed certificates) To do this I used network security configuration (on Android from version 7.0 N, 24 API) So: In res>xml>network_security_config.xml <?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config> <domain includeSubdomains=

Android embed video in iframe not resized on webview height change

*爱你&永不变心* 提交于 2019-12-21 23:12:04
问题 I am trying to play embeded youtube videos in webview. My problem is when I rotate screen and resize webview height, iframe is not changing its height. String embedSrc = "https://www.youtube.com/embed/8SeRU_ZPDkE"; String iframe = "<html><body style=\"margin: 0; padding: 0; background: #000;\"><iframe width=\"100%\" height=\" 100% \" src=\"" + embedSrc + "frameborder=\"0\" allowfullscreen style=\"background: #000;\"></iframe></body></html>"; webView.loadData(iframe, "text/html", "utf-8");

Screenshot of a webpage with Flash elements

可紊 提交于 2019-12-21 20:28:21
问题 I would like to take a screenshot of a page displayed in a WebView. The page contains flash elements - and here is the problem. When I take a screenshot all the flash parts of the page are blank. I am using this piece of code to take a screenshot: WebView webView = (WebView) findViewById(R.id.webview); Picture picture = webView.capturePicture(); Bitmap screenshot = Bitmap.createBitmap(picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888); Canvas c = new Canvas(screenshot); picture