Search in sources :

Example 1 with CachedTrendsSQLiteOpenHelper

use of com.github.moko256.twicalico.database.CachedTrendsSQLiteOpenHelper in project twicalico by moko256.

the class TrendsFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    list = new ArrayList<>();
    subscription = new CompositeSubscription();
    helper = new CachedTrendsSQLiteOpenHelper(getContext(), GlobalApplication.userId);
    if (savedInstanceState == null) {
        List<Trend> trends = helper.getTrends();
        if (trends.size() > 0) {
            list = trends;
            setRefreshing(false);
        }
    }
    super.onCreate(savedInstanceState);
}
Also used : CompositeSubscription(rx.subscriptions.CompositeSubscription) Trend(twitter4j.Trend) CachedTrendsSQLiteOpenHelper(com.github.moko256.twicalico.database.CachedTrendsSQLiteOpenHelper)

Aggregations

CachedTrendsSQLiteOpenHelper (com.github.moko256.twicalico.database.CachedTrendsSQLiteOpenHelper)1 CompositeSubscription (rx.subscriptions.CompositeSubscription)1 Trend (twitter4j.Trend)1