Android Webview upload 图片上传,移动客户端开发面试

public ValueCallback uploadMessage;

public ValueCallback mUploadMessage;

public ProgressBar mWebLoadingProgressBar;

@SuppressLint(“NewApi”)

@Override

public void onActivityResult(int requestCode, int resultCode, Intent intent) {

if (requestCode == FILECHOOSER_RESULTCODE) {

if (null == mUploadMessage) return;

Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();

mUploadMessage.onReceiveValue(result);

mUploadMessage = null;

} else if (requestCode == REQUEST_SELECT_FILE) {

if (uploadMessage == null) return;

uploadMessage.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(resultCode, intent));

uploadMessage = null;

}

}

2  设置webview 的 WebViewClient

mWebView.

你可能感兴趣的:(程序员,面试,移动开发,android)