How to enable uploading in sketchware
Code.1
webview.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;
}
});
Code2.
}
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); }
Not work error
ReplyDeleteWhy....
ReplyDelete1. ERROR in /storage/emulated/0/.sketchware/mysc/ 601/app/src/main/java/com/kicau/mania/ MainActivity.java (at line 224) @Override protected void onActivityResult(int requestCode, intresultCode, Intent intent) { if (requestCode PICKFILE_REQUEST_CODE) (Uri result -intentnull I| resultCode!- RESULT_OK? null: intent.getData0; The method onActivityResult(int, int, Intent) of type new View.OnClickListener00 must override or implement asupertype method 1 problem (1 error)
Please help..
Turn on you app compact in the menu sketchware
DeleteError
ReplyDelete