Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.os.StrictMode instances=2; limit=1

Tags:

java

android

I use the StrictMode in my application , the api android 4.0.3, in my BaseApp i detect all.

    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);

then. I just call the this.finish() , in my activity : always show this error. why? whether I use the android:launchMode="singleInstance" in my Manifest.xml,they always show this error why?

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)
like image 275
vanshu Avatar asked Jun 27 '12 07:06

vanshu


1 Answers

This is know issue of Strict Mode. I prefer to ignore it.

like image 158
user1999680 Avatar answered Nov 20 '22 10:11

user1999680