<string name="welcome_msg">Welcome to the CyanogenMod file manager.\n\nThis app allows you to explore the file system and do operations that could break your device. To prevent damage, the app will start in a safe, low-privileged mode.\n\nYou can access the advanced, full-privileged mode via Settings. It\'s your responsibility to ensure that an operation doesn\'t break your system.\n\nThe CyanogenMod Team</string>
<string name="activity_not_found_exception">Couldn\'t find an app to open this file</string>
- <string name="storage_permissions_denied">Storage permissions denied!</string>
+
+ <string name="storage_permissions_denied">The app cannot run without permission to write to external storage.</string>
</resources>
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
+import android.Manifest;
import android.net.Uri;
import android.nfc.NfcAdapter;
import android.nfc.NfcEvent;
private static final int REQUEST_CODE_STORAGE_PERMS = 321;
private boolean hasPermissions() {
- String permission = "android.permission.WRITE_EXTERNAL_STORAGE";
- int res = checkCallingOrSelfPermission(permission);
+ int res = checkCallingOrSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
return (res == PackageManager.PERMISSION_GRANTED);
}
private void requestNecessaryPermissions() {
String[] permissions = new String[] {
- "android.permission.WRITE_EXTERNAL_STORAGE"
+ Manifest.permission.WRITE_EXTERNAL_STORAGE,
};
requestPermissions(permissions, REQUEST_CODE_STORAGE_PERMS);
}