android.os.StrictMode instances = 2;极限= 1

时间:2012-06-27 07:01:27

标签: java android

我在我的StrictMode我的应用程序中使用了BaseApp api android 4.0.3 我发现了所有。

    builder.detectAll();
    builder.penaltyLog(); 
    StrictMode.VmPolicy vmp = builder.build();
    StrictMode.setVmPolicy(vmp);

    StrictMode.ThreadPolicy.Builder builder1= new StrictMode.ThreadPolicy.Builder();
    builder1.detectAll();
    builder1.penaltyLog();
    StrictMode.ThreadPolicy tdp=builder1.build();
    StrictMode.setThreadPolicy(tdp);

然后。我只是在我的活动中调用this.finish():始终显示此错误。为什么?我是否在我的Manifest.xml中使用android:launchMode =“singleInstance”,它们总是显示此错误原因?

06-27 14:47:34.725: E/StrictMode(18592): class com.onecard.ui.business.AllBusinessActivity; instances=2; limit=1
06-27 14:47:34.725: E/StrictMode(18592): android.os.StrictMode$InstanceCountViolation: class com.onecard.ui.business.AllBusinessActivity; instances=2; limit=1
06-27 14:47:34.725: E/StrictMode(18592):    at android.os.StrictMode.setClassInstanceLimit(StrictMode.java:1)

1 个答案:

答案 0 :(得分:2)

这是严格模式的已知问题。我宁愿忽略它。