Example usage for android.widget Adapter NO_SELECTION

List of usage examples for android.widget Adapter NO_SELECTION

Introduction

In this page you can find the example usage for android.widget Adapter NO_SELECTION.

Prototype

int NO_SELECTION

To view the source code for android.widget Adapter NO_SELECTION.

Click Source Link

Usage

From source file:io.rapidpro.androidchannel.MessageListFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    m_adapter = new SimpleCursorAdapter(getActivity(), R.layout.command, null,
            new String[] { DBCommandHelper.COL_CMD, DBCommandHelper.COL_CREATED, DBCommandHelper.COL_TITLE,
                    DBCommandHelper.COL_BODY, DBCommandHelper.COL_STATE, DBCommandHelper.COL_STATE,
                    DBCommandHelper.COL_STATE, DBCommandHelper.COL_STATE },
            new int[] { R.id.commandIcon, R.id.commandDate, R.id.commandTitle, R.id.commandBody, R.id.small1,
                    R.id.small2 },/*w  w w.  ja  v  a  2  s. com*/
            Adapter.NO_SELECTION);

    m_adapter.setViewBinder(new DBCommandViewBinder());

    setListAdapter(m_adapter);
    setListShown(false);
}

From source file:edu.princeton.jrpalmer.asmlibrary.ListMyDataCursorLoader.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.list_my_data);

    context = getBaseContext();//from   ww w .  j  ava  2s . c  o m

    getSupportLoaderManager().initLoader(LOADER_ID, null, this);

    adapter = new ListDataCursorAdapter(this, R.layout.dblistitem, null,
            new String[] { "timelong", "latitude", "longitude", "altitude", "accuracy", "provider",
                    "sdtimelong" },
            new int[] { R.id.firstTimeLong, R.id.latitude, R.id.longitude, R.id.altitude, R.id.accuracy,
                    R.id.provider, R.id.sdTimeLong },
            Adapter.NO_SELECTION);

    ListView listView = (ListView) findViewById(R.id.listDataListView);
    listView.setAdapter(adapter);

    listView.setFastScrollEnabled(true);

    mNewFixBlinker = (TextView) findViewById(R.id.newFixBlinker);
    mNewFixBlinker.setVisibility(View.INVISIBLE);

    // Log.e(TAG, "onCreate");
}

From source file:se.team05.activity.ListExistingResultsActivity.java

/**
 * Extracts route id from intent passed in to the activity and gets
 * all results connected to that route. Then displays them in a list
 * view through a ListResultsAdapter. Finally displays a chart with all
 * the results./* www  .  j  av a  2s  . com*/
 */
@Override
public void onResume() {
    super.onResume();
    long rid = getIntent().getLongExtra(Route.EXTRA_ID, -1);
    DatabaseHandler db = new DatabaseHandler(this);

    Cursor cursor = db.getAllResultsCursorByRid(rid);

    ListResultsAdapter adapter = new ListResultsAdapter(this, android.R.layout.simple_list_item_1, cursor,
            new String[] { DBResultAdapter.COLUMN_TIMESTAMP }, new int[] { android.R.id.text1 },
            Adapter.NO_SELECTION);
    setListAdapter(adapter);
    //cursor.close();
    List<Result> allResults = db.getAllResultsByRid(rid);
    if (allResults != null && allResults.size() > 0) {
        LinearLayout chartContainer = (LinearLayout) findViewById(R.id.chart);
        GraphicalView timeStretchChartView = TimeStretchChartView.getNewInstance(this, allResults,
                db.getRoute(rid).getName());
        chartContainer.addView(timeStretchChartView);
    }
}

From source file:org.kiwix.kiwixmobile.ZimFileSelectActivity.java

protected void startQuery() {

    // Defines a list of columns to retrieve from the Cursor and load into an output row
    String[] mZimListColumns = { MediaStore.Files.FileColumns.TITLE, MediaStore.Files.FileColumns.DATA };

    // Defines a list of View IDs that will receive the Cursor columns for each row
    int[] mZimListItems = { android.R.id.text1, android.R.id.text2 };

    mCursorAdapter = new SimpleCursorAdapter(
            // The Context object
            ZimFileSelectActivity.this,
            // A layout in XML for one row in the ListView
            android.R.layout.simple_list_item_2,
            // The cursor, swapped later by cursorloader
            null,/*from  www  .j av  a 2 s  .c  o m*/
            // A string array of column names in the cursor
            mZimListColumns,
            // An integer array of view IDs in the row layout
            mZimListItems,
            // Flags for the Adapter
            Adapter.NO_SELECTION);

    getSupportLoaderManager().initLoader(LOADER_ID, null, this);
}