webchromeclient

Android progressbar on webview appearing twice

Deadly 提交于 2020-01-07 06:17:09
问题 I'm trying to create a simple app for android with progress bar . Everything works fine. But, here two issues 1) When the application is launched i can see progress loading twice. 2) How can i disable the progress bar after the initial page is finished loading. I dont want to show the progressbar on each click.. Here is my code package com.mycom.jquery; import android.app.Activity; import android.app.ProgressDialog; import android.os.Bundle; import android.view.Window; import android.webkit

Upload photo from gallery or take from camera in Webview

坚强是说给别人听的谎言 提交于 2020-01-02 19:12:44
问题 My application is webbased and need to upload photos, website have a file input button, i made it work with this wv = new WebView(this); wv.setWebViewClient(new WebViewClient()); wv.getSettings().setJavaScriptEnabled(true); wv.getSettings().setAllowFileAccess(true); wv.setWebChromeClient(new WebChromeClient() { public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture){ mUploadMessage = uploadMsg; Intent i = new Intent(Intent.ACTION_GET_CONTENT); i

Upload photo from gallery or take from camera in Webview

纵饮孤独 提交于 2020-01-02 19:12:10
问题 My application is webbased and need to upload photos, website have a file input button, i made it work with this wv = new WebView(this); wv.setWebViewClient(new WebViewClient()); wv.getSettings().setJavaScriptEnabled(true); wv.getSettings().setAllowFileAccess(true); wv.setWebChromeClient(new WebChromeClient() { public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture){ mUploadMessage = uploadMsg; Intent i = new Intent(Intent.ACTION_GET_CONTENT); i

Android WebView WebChromeClient : inaccurate progress value in onProgressChanged()

旧街凉风 提交于 2020-01-01 10:15:28
问题 I need to access the progress value in WebView -> WebChromeClient -> onProgressChanged(). The progress integer value doesn't increment from 0 to 100 but rather jumps around. Here is a sample log-output from loading one page and the associated progress numbers: DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 10 DEBUG: progress : 100 DEBUG: progress : 10 DEBUG: progress : 100

Android WebView localStorage

*爱你&永不变心* 提交于 2019-12-23 02:44:12
问题 I'm attempting to get a HTML5 localStorage example working within an Android WebView (Webkit, ChromeClient). However I'm having no luck. Everything works from the phones browsers just not from the WebView. Activity: public class BrowserActivity extends Activity { @Override public final void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); WebView browser = (WebView) findViewById(R.id.webView); browser.setHapticFeedbackEnabled(true)

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

Are WebViewClient and WebChromeClient mutually exclusive?

风格不统一 提交于 2019-12-17 17:28:44
问题 From this great explanation about the differences between WebViewClient and WebChromeClient it seems that if you use one, you shouldn't be using the other (for the same WebView object). Is my understanding correct? If not, when would one use both WebViewClient and WebChromeClient for the same WebView object? Is there an example of a situation where only use both WebViewClient and WebChromeClient for the same WebView object would accomplish a certain goal? 回答1: You certainly can use both, they

Overriding Android WebChromeClient's onCreateWindow method results in SIGSEGV

杀马特。学长 韩版系。学妹 提交于 2019-12-13 02:57:53
问题 I tried to override the default WebChromeClient in order to get give my application's WebView the ability to open new windows. For this, as instructed in the manual, I'm overriding the 'onCreateWindow' method of WebChromeClient wherein I do the following simple logic. public boolean onCreateWindow (WebView view, boolean dialog, boolean userGesture, Message resultMsg) { ((WebView.WebViewTransport) resultMsg.obj).setWebView(myWebView); Log.d("webviewdemo", "from the chrome client"); resultMsg

Embedded Youtube player getting cut off

家住魔仙堡 提交于 2019-12-13 01:33:37
问题 I am trying to embed youtube video in my android app using WebView. Here is the code: { WebView mView = new WebView(getContext()); String embeded = loadPlayer(); // this is javascript string containing YtPlayer api WebSettings webSettings = mPreview.getSettings(); webSettings.setJavaScriptEnabled(true); mView.setBackgroundColor(535353); WebChromeClient mChromeClient = new WebChromeClient(); mView.setWebChromeClient(mChromeClient); mView.setWebViewClient(new WebViewClient()); mView

Upload photo from gallery or take from camera in Webview

蓝咒 提交于 2019-12-06 06:03:35
My application is webbased and need to upload photos, website have a file input button, i made it work with this wv = new WebView(this); wv.setWebViewClient(new WebViewClient()); wv.getSettings().setJavaScriptEnabled(true); wv.getSettings().setAllowFileAccess(true); wv.setWebChromeClient(new WebChromeClient() { public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture){ mUploadMessage = uploadMsg; Intent i = new Intent(Intent.ACTION_GET_CONTENT); i.addCategory(Intent.CATEGORY_OPENABLE); i.setType("image/*"); MainActivity.this.startActivityForResult( Intent