Example usage for android.support.v4.content Loader Loader

List of usage examples for android.support.v4.content Loader Loader

Introduction

In this page you can find the example usage for android.support.v4.content Loader Loader.

Prototype

public Loader(Context context) 

Source Link

Document

Stores away the application context associated with context.

Usage

From source file:es.esy.vivekrajendran.news.fragments.LatestNewsFragment.java

@Override
public boolean onQueryTextChange(String newText) {
    String queryString = "SELECT * FROM " + NewsContract.News.TABLE_NAME + " WHERE  "
            + NewsContract.News.COLUMN_DESCRIPTION + " LIKE '%" + newText + "%'";

    Cursor cursor = new DBHelper(getContext()).getReadableDatabase().rawQuery(queryString, null);
    onLoadFinished(new Loader<Cursor>(getContext()), cursor);
    return true;/*from  w w  w  .  jav a 2  s. com*/
}