0
我想上传一个webview文件。当我点击选择按钮为3.0以上的Android版本的设备不在选择器中显示录音机选项。 这里是我的代码android openfilechooser不显示Android版3.0以下的录音笔
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
String path = Environment.getExternalStorageDirectory().toString();
File file = new File(path, "temp.jpg");
file.delete();
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("*/*");
Intent openInChooser=Intent.createChooser(i,"File Chooser");
Intent value[]=new Intent[2];
value[0]= new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
value[0].addCategory(Intent.CATEGORY_OPENABLE);
Intent fileExplorer= new Intent(MainActivity.this,DirectoryBrowser.class);
fileExplorer.setComponent(new ComponentName(MainActivity.this, DirectoryBrowser.class));
value[1] = new LabeledIntent(fileExplorer, "com.app.insta7", "File Explorer", R.drawable.folder);
openInChooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, value);
MainActivity.this.startActivityForResult(openInChooser, FILECHOOSER_RESULTCODE);
}
,如果我这条线,增加意图数组大小增加3
的设备版本低于3.0选配的显示选项twice.kindly建议的解决方案,如果你这个问题有什么。