这是我的html浏览代码.
????
这是我的android代码,它为浏览文件加载html文件并在服务器上传.
runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
System.out.println(AndroidConstants.MAIN_URL());
toast(AndroidConstants.MAIN_URL());
webView.loadUrl(AndroidConstants.MAIN_URL());
webView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype,
long contentLength) {
// TODO Auto-generated method stub
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
public void openFileChooser(ValueCallback uploadMsg) {
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
WebViewActivity.this.startActivityForResult(Intent.createChooser(i,"Image Chooser"), 2533);
}
public void openFileChooser(ValueCallback uploadMsg, String acceptType) {
openFileChooser(uploadMsg);
}
public void openFileChooser(ValueCallback uploadMsg, String acceptType, String capture) {
openFileChooser(uploadMsg);
}
});
}
});
JavaScriptInterface jsInterface = new JavaScriptInterface(this);
webView.getSettings().setJavaScriptEnabled(true);
我想在Android应用程序上使用html5上传视频文件.