Created
August 29, 2016 20:19
-
-
Save murki/c3801d25d6a1736e85428ddd68c580c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// wrapping synchronous operation in an RxJava Observable | |
Observable<Boolean> wipeContents(final SharedPreferences sharedPreferences) { | |
return Observable.fromCallable(new Callable<Boolean>() { | |
@Override | |
public Boolean call() throws Exception { | |
return sharedPreferences.edit().clear().commit(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment