//APP开启StrictMode严格模式
@TargetApi(9)
protected void setStrictMode() {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().permitAll().build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
}
//报错
04-07 17:00:11.742 17784-17791/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:180)
at java.io.FileInputStream.(FileInputStream.java:78)
at com.jakewharton.disklrucache.DiskLruCache.get(DiskLruCache.java:422)
at com.zhouyou.http.cache.core.LruDiskCache.doContainsKey(LruDiskCache.java:112)
at com.zhouyou.http.cache.core.BaseCache.containsKey(BaseCache.java:131)
at com.zhouyou.http.cache.core.BaseCache.load(BaseCache.java:50)
at com.zhouyou.http.cache.core.CacheCore.load(CacheCore.java:60)
at com.zhouyou.http.cache.RxCache$2.execute(RxCache.java:176)
at com.zhouyou.http.cache.RxCache$SimpleSubscribe.subscribe(RxCache.java:134)
at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableFlatMap.subscribeActual(ObservableFlatMap.java:55)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableOnErrorNext.subscribeActual(ObservableOnErrorNext.java:38)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableConcatMap$ConcatMapDelayErrorObserver.drain(ObservableConcatMap.java:475)
at io.reactivex.internal.operators.observable.ObservableConcatMap$ConcatMapDelayErrorObserver.onSubscribe(ObservableConcatMap.java:330)
at io.reactivex.internal.operators.observable.ObservableFromArray.subscribeActual(ObservableFromArray.java:31)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableConcatMap.subscribeActual(ObservableConcatMap.java:55)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableFilter.subscribeActual(ObservableFilter.java:30)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableDistinctUntilChanged.subscribeActual(ObservableDistinctUntilChanged.java:35)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableRetryWhen$RepeatWhenObserver.subscribeNext(ObservableRetryWhen.java:151)
at io.reactivex.internal.operators.observable.ObservableRetryWhen.subscribeActual(ObservableRetryWhen.java:60)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.Observable.subscribeWith(Observable.java:12319)
at com.zhouyou.http.request.GetRequest.execute(GetRequest.java:92)
at com.example.okx.net.request.CustomGetRequest.execute(CustomGetRequest.java:34)
//APP开启StrictMode严格模式 @TargetApi(9) protected void setStrictMode() { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().permitAll().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build()); } //报错 04-07 17:00:11.742 17784-17791/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. java.lang.Throwable: Explicit termination method 'close' not called at dalvik.system.CloseGuard.open(CloseGuard.java:180) at java.io.FileInputStream.(FileInputStream.java:78)
at com.jakewharton.disklrucache.DiskLruCache.get(DiskLruCache.java:422)
at com.zhouyou.http.cache.core.LruDiskCache.doContainsKey(LruDiskCache.java:112)
at com.zhouyou.http.cache.core.BaseCache.containsKey(BaseCache.java:131)
at com.zhouyou.http.cache.core.BaseCache.load(BaseCache.java:50)
at com.zhouyou.http.cache.core.CacheCore.load(CacheCore.java:60)
at com.zhouyou.http.cache.RxCache$2.execute(RxCache.java:176)
at com.zhouyou.http.cache.RxCache$SimpleSubscribe.subscribe(RxCache.java:134)
at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableFlatMap.subscribeActual(ObservableFlatMap.java:55)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableOnErrorNext.subscribeActual(ObservableOnErrorNext.java:38)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableConcatMap$ConcatMapDelayErrorObserver.drain(ObservableConcatMap.java:475)
at io.reactivex.internal.operators.observable.ObservableConcatMap$ConcatMapDelayErrorObserver.onSubscribe(ObservableConcatMap.java:330)
at io.reactivex.internal.operators.observable.ObservableFromArray.subscribeActual(ObservableFromArray.java:31)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableConcatMap.subscribeActual(ObservableConcatMap.java:55)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableFilter.subscribeActual(ObservableFilter.java:30)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableDistinctUntilChanged.subscribeActual(ObservableDistinctUntilChanged.java:35)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableRetryWhen$RepeatWhenObserver.subscribeNext(ObservableRetryWhen.java:151)
at io.reactivex.internal.operators.observable.ObservableRetryWhen.subscribeActual(ObservableRetryWhen.java:60)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.Observable.subscribeWith(Observable.java:12319)
at com.zhouyou.http.request.GetRequest.execute(GetRequest.java:92)
at com.example.okx.net.request.CustomGetRequest.execute(CustomGetRequest.java:34)