修改GlobalScreenshot.java的saveImageInBackgroundTask方法: String imageDir = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES).getAbsolutePath(); 1、JB2修改为: String imageDir = StorageManager.getDefaultPath() + '/' + Environment.DIRECTORY_PICTURES ; 2、JB3.TDD修改为:同时需要导入 import com.mediatek.storage.StorageManagerEx; String imageDir = StorageManagerEx.getDefaultPath() + '/' + Environment.DIRECTORY_PICTURES ; 3、KK上修改为: (1) import import com.mediatek.storage.StorageManagerEx;(2) mScreenshotDir = new File(StorageManagerEx.getDefaultPath() + "/" + Environment.DIRECTORY_PICTURES , SCREENSHOTS_DIR_NAME) ; (3) 在frameworks/ base/packages/SystemUI/AndroidManifest.xml添加如下code: <uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" /> |
转载于:https://my.oschina.net/u/2419070/blog/480597