Use Handler callback instead of sleep() to catch InteruptedException.
The sleep used to simulate data load times is ignoring InterruptedExceptions. (This is intended and in line with SystemClock.sleep()). However, when a Loader cancels an ongoing load, it uses interrupts. To be able to catch these and to immediately return from the reading data source, a handler callback is used instead of the sleep() method which allows interuptable waiting. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=168212652
Showing
with
1 additions
and
1 deletions
Please
register
or
sign in
to comment