Skip to content

Instantly share code, notes, and snippets.

View roxrook's full-sized avatar
🏃‍♂️
Runner for life!

Chan Nguyen roxrook

🏃‍♂️
Runner for life!
View GitHub Profile
@roxrook
roxrook / CursorSubject.java
Last active August 29, 2015 14:27 — forked from imminent/CursorSubject.java
CursorSubject is a Reactive Extension version of Android's CursorLoader. Handles retrieving the Cursor in a background thread, sending the result Cursor on the main thread, and resending a Cursor whenever the content changed notification is triggered.
package com.example.models;
import android.database.ContentObserver;
import android.database.Cursor;
import android.os.Handler;
import android.os.Looper;
import java.io.Closeable;
import java.util.concurrent.atomic.AtomicReference;
#include <iostream>
#include <vector>
#include <string>
#include <cstdio>
#include <algorithm>
#include <climits>
#include <utility>
#include <fstream>
#include <map>
#include <cmath>