当我在我的应用程序中的attachement按钮时,我收到一些错误 [英] I am getting some errors when I on attachement button in my app

查看:86
本文介绍了当我在我的应用程序中的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.


这篇关于当我在我的应用程序中的attachement按钮时,我收到一些错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆