草庐IT

StrictModeDiskReadViolation

全部标签

android - Android 中的 StrictMode 策略违规 : StrictModeDiskReadViolation, WriteViolation

我正在开发一个使用Googlemap的Android项目。该应用程序在我的手机上运行良好,具有5.1.1Android版本,因为我将它用于项目的开发,但同一应用程序在其他手机(6.0.0Android)中无法运行。在其他手机上,谷歌地图没有更新。(不去当前位置)。为什么谷歌地图在其他手机上没有更新?提示这个;12-1308:25:55.79611170-11170/com.example.mapspractice1W/f:SuppressedStrictModepolicyviolation:StrictModeDiskReadViolation12-1308:25:55.796111

android - StrictModeDiskReadViolation 时

我正在尝试使用SharedPreferences为我的应用程序存储一些用户设置。我的Activity.onCreate方法中有这段代码:sharedPreferences=context.getSharedPreferences("MMPreferences",0);soundOn=sharedPreferences.getBoolean("soundOn",true);但它给了我这个错误(产生错误的是getBoolean):11-1016:32:24.652:D/StrictMode(706):StrictModepolicyviolation;~duration=229ms:and

android - StrictMode 策略违规 : android. os.StrictMode$StrictModeDiskReadViolation : policy=327711 violation=2 at Application super. onCreate

当我打开严格模式检测全部时,我的应用程序崩溃了应用程序的super.onCreate()(即,甚至在我的任何代码执行任何操作之前)。我的应用程序onCreate开启严格模式如下overridefunonCreate(){if(BuildConfig.DEBUG){StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().penaltyDeath().build())StrictMode.setVmPolicy(StrictMode.VmPolicy.Builder().de