This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void copyBigDataToSD(String strOutFileName) { | |
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) | |
!= PackageManager.PERMISSION_GRANTED) { | |
//申请WRITE_EXTERNAL_STORAGE权限 | |
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_EXTERNAL_STORAGE}, | |
1); | |
} | |
InputStream myInput = null; | |
OutputStream myOutput = null; | |
File myDir = new File(strOutFileName); |