android-webview

get scroll Y of RecyclerView or Webview

纵然是瞬间 提交于 2019-12-21 04:08:30
问题 I have created a activity Webview content placed in Recyclerview . I want to get the scroll Y position when I scroll webview. I tried Webview.getScrollY() , Webview.getY() , RecyclerView.getScrollY() , RecyclerView.getY() ,... but it do not work fine. I can't get current scroll Y. Is there any suggest for get scroll Y of Webview or RecyclerView ? 回答1: Use a RecyclerView.OnScrollListener for the RecyclerView and a View.OnScrollChangeListener for the webview. You'll have to keep track of the

Which one to use WebView or TextView in a list with HTML data in it?

爱⌒轻易说出口 提交于 2019-12-21 03:43:32
问题 In the name of performance which is better to use list of webview objects with custom array adapter defined or list of textview object again with custom adapter and html content to show in it.First I try to use webview but i think webview object is kind of heavy ui element , textview seems more lightweight. WebView entryWebView = (WebView) findViewById(R.id.entryWebView); entryWebView.loadData("my hmtl formatted data", "text/html", "utf-8"); //suppose these defined in custom array adapter and

Images not loading in android webview

北城余情 提交于 2019-12-21 03:21:37
问题 I am trying to load the site in an android app web view. The site loads without the images ,all the images from the site are not loaded what could be the problem. The code for onCreate is shown below. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); String url = getResources().getString(R.string.web_url); web = (WebView) findViewById(R.id.webview01); progressBar = (ProgressBar) findViewById(R.id.progressBar1); web

Workaround for file uploads on Android 4.4 using reflection

做~自己de王妃 提交于 2019-12-21 02:38:12
问题 From Android 4.1 to Android 4.3, you could subclass WebChromeClient on Android and implement the following (hidden, thus no @Override ) method: public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) { ... } You would open a file picker in that method, and when your Activity receives the result in onActivityResult(...) , just call the single method that is available on the ValueCallback<Uri> instance with the file URI. That's it. Unfortunately, this method

React Native: Webview getUserMedia not working (onPermissionRequest override?)

我的梦境 提交于 2019-12-20 21:00:47
问题 I'm developing an application for iOS, Android and Windows with React Native in which I need to show a webpage through a WebView . That webpage accesses the camera of the device, so it uses MediaDevices.getUserMedia() Javascript function. It works without problems in desktop, even in the Chrome app on the smartphone . However, when I call the webpage via the React Native <WebView /> , I get a PermissionDenied error. The problem is that no request is shown to let me accept that permission. It

Unable to get current URL on click event of WebView in Android

℡╲_俬逩灬. 提交于 2019-12-20 14:19:20
问题 private WebView wv; public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.infoweblinkview); wv=(WebView) findViewById(R.id.weblinkview); wv.setWebViewClient(new WebViewClient()); wv.getSettings().setJavaScriptEnabled(true); wv.loadUrl(getString(R.string.infourl)); wv.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub String previousUrl = wv.getUrl(); } }); } 回答1: for that, your can override some

Cordova doesn't send origin on request in some Android devices

試著忘記壹切 提交于 2019-12-20 14:15:45
问题 This is a problem that happens on some android devices. I have a Samsung Galaxy A5 (2017) with Google Chrome version 76.0.3809.89 and Android version 8.0.0. When I deploy my Cordova application for the first time on this device and making a POST request I receive an error about CORS: Access to XMLHttpRequest at 'http://foo.com/bar' from origin 'file://' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is

Cordova doesn't send origin on request in some Android devices

半世苍凉 提交于 2019-12-20 14:14:40
问题 This is a problem that happens on some android devices. I have a Samsung Galaxy A5 (2017) with Google Chrome version 76.0.3809.89 and Android version 8.0.0. When I deploy my Cordova application for the first time on this device and making a POST request I receive an error about CORS: Access to XMLHttpRequest at 'http://foo.com/bar' from origin 'file://' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is

How can I implement a chrome like “auto-hide navigation” for my Android app?

吃可爱长大的小学妹 提交于 2019-12-20 10:57:06
问题 In Chrome, the address bar will be hidden/shown when user swipes up/down the content. Can I implement the similar logic to my app? <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" tools:ignore="MergeRootFrame"> <WebView android:id="@+id/my_webview" android:layout_width="match_parent" android

Load all fragments on app opening

橙三吉。 提交于 2019-12-20 10:40:00
问题 I have an app that uses fragments to create a page adapter. I use this to create a swipe tab which loads a different fragment. Each fragment loads webview which displays a specially formatted website. Right now my app only loads the fragments it is on and the ones to the left and right of it. I would like to load all six tabs at once and never again. Is there a way to do this? import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.Fragment; import