我从画廊使用Uri获取图像
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Choose Picture"), requestCode);
Run Code Online (Sandbox Code Playgroud)
并尝试显示图像
imageView.setImageURI(uri);
Run Code Online (Sandbox Code Playgroud)
这里,uri是intent.getData()在onActivityResult中收到的图像的Uri.
但没有显示图像.另外,为
File file=new File( uri.getPath() );
Run Code Online (Sandbox Code Playgroud)
file.exists()返回false.
你好,我是android开发的新手我想知道如何在android上传图像我没有找到任何有用的教程,你可以给我一些指导,请帮助我.