I already looked the 'webview fileup load' post from stack overflow but mine does not show any pop up. please look at it more carefully
Let say I have following html code to access the android gallery.
<form method="POST" enctype="multipart/form-data">
File to upload: <input type="file" name="uploadfile">
<input type="submit" value="Press to Upload..."> to upload the file!
</form>
after I implemented the onCreate. and when I click the button for the file upload. it does not open anything. but it only showed
D/mali_winsys: new_window_surface returns 0x3000, [1440x2560]-format:1
this is an error message.
and following is the code for onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
web = (WebView)findViewById(R.id.webView);
ln1=(LinearLayout) findViewById(R.id.ln1);
WebSettings settings = web.getSettings();
settings.setJavaScriptEnabled(true);
web.loadUrl("http://github.tkddnjsdja.tk/");
web.setWebViewClient(new myWebClient());
web.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.createChooser(i, "File Chooser"), MainActivity.FILECHOOSER_RESULTCODE);
}
});
//setContentView(web);
}
when I click the button it only shows
and nothing changed. any one help?
i gaved following permissions
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name ="android.permission.CAMERA"></uses-permission>
<uses-permission android:name="android.hardware.camera"></uses-permission>