Store icon indicating copy to clipboard operation
Store copied to clipboard

Clearable

Open victor-radulescu opened this issue 6 years ago • 2 comments

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

victor-radulescu avatar Oct 17 '18 11:10 victor-radulescu

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

victor-radulescu avatar Oct 17 '18 11:10 victor-radulescu

I think you need to handle the case where you are clearing something for a key/path that is not created yet.

digitalbuddha avatar Dec 31 '18 17:12 digitalbuddha