当我在我的应用程序中的attachement按钮时,我收到一些错误

问题描述:

Hello Guys,当我在我的应用程序中附加模拟器中的任何内容时出现错误,所以我得到了这个错误抱歉,授予存储权限第一次!

拜托,伙计们,帮助我。谢谢



我尝试过:



public void onActivityResult(int requestCode,int resultCode ,意图意图){

super.onActivityResult(requestCode,resultCode,intent);

try {

Uri mImageCaptureUri = intent.getData() ;

String filePath = PathUtil.getPath(this,mImageCaptureUri);

file = new File(filePath);

imageView =(ImageView) findViewById(R.id.your_image);

imageView.setImageURI(mImageCaptureUri);

attachment = 1;

Log.e(URI文件,mImageCaptureUri +);

} catch(例外e){

Toast.makeText(MainActivity.this,抱歉,Grant Storag e权限FIrst!,Toast.LENGTH_SHORT)。show();

Log.e(异常解码,e +);

}

}

Hello Guys, am getting an error when I attach anything from emulator in my app so am getting this error sorry, Grant Storage Permissions FIrst!
please, guys, help me.Thanks

What I have tried:

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
try {
Uri mImageCaptureUri = intent.getData();
String filePath = PathUtil.getPath(this,mImageCaptureUri);
file = new File(filePath);
imageView = (ImageView) findViewById(R.id.your_image);
imageView.setImageURI(mImageCaptureUri);
attachment = 1;
Log.e("URI File" , mImageCaptureUri+"");
} catch (Exception e) {
Toast.makeText(MainActivity.this, "Sorry, Grant Storage Permissions FIrst !", Toast.LENGTH_SHORT).show();
Log.e("Exception Decode" , e + "");
}
}

授予存储权限第一个!

您需要设置正确的权限在您的清单中,如Android文档中所列。
Grant Storage Permissions FIrst!
You need to set the correct permissions in your manifest, as listed in the Android documentation.