Store
Store copied to clipboard
Clearable
I don't understand how to implement a Clearable<Barcode> I have this class ClearAbleRecordPersister extends RecordPersister implements Clearable<BarCode> { ... @Override public void clear(@NonNull BarCode key) { //TODO what show i do here? } My Store persister instance: val cacheDir: File = MyApplication.getContext().cacheDir return ClearAbleRecordPersister.create(cacheDir,30,TimeUnit.MINUTES) }
Could not erase the data in any way. Can someone help me with it
tryed the folowing in onClear method
fileEraser.delete(key)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<Boolean>() {
@Override
public void onSubscribe(Disposable d) {
Log.d("clearing", "subscribe");
}
@Override
public void onNext(Boolean aBoolean) {
Log.d("clearing", "next " + aBoolean);
}
@Override
public void onError(Throwable e) {
Log.d("clearing", "error " + e.getMessage());
}
@Override
public void onComplete() {
Log.d("clearing", "complete");
}
});
I got this error: : error unable to delete /data/user/0/packagename/cache/subscribtion/42961
I think you need to handle the case where you are clearing something for a key/path that is not created yet.