android - Delay onComplete() in Observable -
i doing this:
return observable.zip( observable.interval(0, move_length_in_millis, timeunit.milliseconds), observable.fromiterable(mysupernicearraylist), new bifunction<long, itemtest, itemtest>() { @override public itemtest apply(@nonnull long along, @nonnull itemtest itemtest) throws exception { return itemtest; } } )
the problem have after last item emitted, oncomplete called. there way postpone/delay call of oncomplete method?
hacky solution add 1 more element arraylist , ignore in onnext().
concat entire zip empty observable
delayed:
return observable.zip( observable.interval(0, move_length_in_millis, timeunit.milliseconds), observable.fromiterable(mysupernicearraylist), new bifunction<long, itemtest, itemtest>() { @override public itemtest apply(@nonnull long along, @nonnull itemtest itemtest) throws exception { return itemtest; } } ).concatwith(observable.<itemtest>empty() .delay(move_length_in_millis, timeunit.milliseconds));
edit delay should happen after zip.
Comments
Post a Comment