Search in sources :

Example 46 with CompositeSubscription

use of rx.subscriptions.CompositeSubscription 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

CompositeSubscription (rx.subscriptions.CompositeSubscription)46 Subscription (rx.Subscription)9 ArrayList (java.util.ArrayList)8 Bundle (android.os.Bundle)6 AndroidSchedulers (rx.android.schedulers.AndroidSchedulers)6 Context (android.content.Context)5 Intent (android.content.Intent)5 AppCompatActivity (android.support.v7.app.AppCompatActivity)5 View (android.view.View)5 ViewGroup (android.view.ViewGroup)5 Schedulers (rx.schedulers.Schedulers)5 RecyclerView (android.support.v7.widget.RecyclerView)4 MenuItem (android.view.MenuItem)4 Issue (com.kboyarshinov.realmrxjavaexample.model.Issue)4 List (java.util.List)4 SharedPreferences (android.content.SharedPreferences)3 ActionBar (android.support.v7.app.ActionBar)3 Menu (android.view.Menu)3 TextView (android.widget.TextView)3 TwitterStringUtils (com.github.moko256.twicalico.text.TwitterStringUtils)3