本文整理汇总了Java中android.os.StrictMode.VmPolicy类的典型用法代码示例。如果您正苦于以下问题:Java VmPolicy类的具体用法?Java VmPolicy怎么用?Java VmPolicy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VmPolicy类属于android.os.StrictMode包,在下文中一共展示了VmPolicy类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initializeStrictMode
import android.os.StrictMode.VmPolicy; //导入依赖的package包/类
private static void initializeStrictMode() {
if (!strictModeInitialized) {
if (SDK_INT >= GINGERBREAD) {
ThreadPolicy.Builder threadPolicy = new ThreadPolicy.Builder();
VmPolicy.Builder vmPolicy = new VmPolicy.Builder();
threadPolicy.detectAll()
.penaltyLog();
vmPolicy.detectAll()
.penaltyLog();
if (STRICT_MODE_KILL_ON_ERROR) {
threadPolicy.penaltyDeath();
vmPolicy.penaltyDeath();
}
StrictMode.setThreadPolicy(threadPolicy.build());
StrictMode.setVmPolicy(vmPolicy.build());
strictModeInitialized = true;
}
}
}
开发者ID:blstream,项目名称:StudyBox_Android,代码行数:24,代码来源:DebugHelper.java
示例2: enableStrictMode
import android.os.StrictMode.VmPolicy; //导入依赖的package包/类
private void enableStrictMode() {
if (TESTING) {
ThreadPolicy.Builder threadPolicy = new ThreadPolicy.Builder();
threadPolicy.detectAll();
threadPolicy.penaltyLog();
StrictMode.setThreadPolicy(threadPolicy.build());
VmPolicy.Builder vmPolicy = new VmPolicy.Builder();
vmPolicy.detectAll();
vmPolicy.penaltyLog();
StrictMode.setVmPolicy(vmPolicy.build());
}
}
开发者ID:rafjordao,项目名称:Nird2,代码行数:13,代码来源:SplashScreenActivity.java
示例3: reset
import android.os.StrictMode.VmPolicy; //导入依赖的package包/类
/**
* @return The current instance of {@link StrictModeHelper}.
*/
public StrictModeHelper reset() {
if (!AppHelper.with(context).isDebuggable()) {
return this;
}
threadBuilder = new ThreadPolicy.Builder();
vmBuilder = new VmPolicy.Builder();
return this;
}
开发者ID:remelpugh,项目名称:android-shared,代码行数:14,代码来源:StrictModeHelper.java
示例4: enableStrictMode
import android.os.StrictMode.VmPolicy; //导入依赖的package包/类
private void enableStrictMode() {
ThreadPolicy.Builder threadPolicy = new ThreadPolicy.Builder();
threadPolicy.detectAll();
threadPolicy.penaltyLog();
StrictMode.setThreadPolicy(threadPolicy.build());
VmPolicy.Builder vmPolicy = new VmPolicy.Builder();
vmPolicy.detectAll();
vmPolicy.penaltyLog();
StrictMode.setVmPolicy(vmPolicy.build());
}
开发者ID:grote,项目名称:Transportr,代码行数:12,代码来源:MapActivity.java
示例5: onCreate
import android.os.StrictMode.VmPolicy; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
setThreadPolicy(new ThreadPolicy.Builder().detectAll().penaltyLog().build());
setVmPolicy(new VmPolicy.Builder().detectAll().penaltyLog().build());
}
开发者ID:google,项目名称:agera,代码行数:7,代码来源:NotesApplication.java
注:本文中的android.os.StrictMode.VmPolicy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论