Widget - Webview Upload

 webview1.setWebChromeClient(new WebChromeClient() {

@Override
public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback, FileChooserParams fileChooserParams) {

mFilePathCallback = filePathCallback;
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
startActivityForResult(intent, PICKFILE_REQUEST_CODE); return true;
}
});

//add Bkock webview loadUrl


}
private ValueCallback <Uri[]> mFilePathCallback;
private static final int PICKFILE_REQUEST_CODE = 0;
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == PICKFILE_REQUEST_CODE) {
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
Uri[] resultsArray = new Uri[1];
resultsArray[0] = result;
mFilePathCallback.onReceiveValue(resultsArray);
}

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

How to enable download in webview in Sketchware apps?

TextInputLayout in Sketchware

Create Stopwatch App in Android using Sketchware

How to integrate Admob Ads in Sketchware project using AIDE?

How to find and​ highlight a word in a text field in Sketchware?

Code for implementing Notifications in Sketchware

A Flash Light App in Sketchware

Create a Stopwatch App using Chronometer in Sketchware

Create app to save all passwords, protected using voice key