step3: 请求存储读写权限
public String[] getPermissions() { String[] permissions = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}; return permissions; } EasyPermissions.requestPermissions(this, "程序运行需要存储权限", RC_PERMISSIONS, getPermissions());step4: 判断是否有权限
String[] permissions = getPermissions(); boolean hasPermissions = EasyPermissions.hasPermissions(this, permissions);