Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
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 + "");
}
}
Posted
Updated 13-Jan-18 23:59pm

1 solution

Grant Storage Permissions FIrst!
You need to set the correct permissions in your manifest, as listed in the Android documentation.
 
Share this answer
 
Comments
Member 9983063 14-Jan-18 4:01am    
which permission please guide me thanks
Member 9983063 14-Jan-18 4:09am    
i am using this permissions in my app <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- Internet permission -->
<uses-feature android:name="android.hardware.camera" android:required="true"
Richard MacCutchan 14-Jan-18 7:45am    
You have not explained where you see this message, or where in your code it occurs, so I have to make a reasoned guess. But see Manifest.permission | Android Developers[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900