artem
artem

Reputation: 16818

Environment.getExternalStorageDirectory() returns null int AndroidTestCase

I have a test case, and using there Environment.getExternalStorageDirectory() call, and it returns null.

I have the "write external storage" permission in app's manifest (and sd cards works fine in app), but it does not work in test case. Why and how to fix it?

Device is SGS3, os version is 4.4.

Debugger

Upvotes: 3

Views: 877

Answers (1)

Rishad Appat
Rishad Appat

Reputation: 1808

you have to add the below permission in the Manifest.xml

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Upvotes: 3

Related Questions