Code example for GridView

Methods: setAdapter

0
 
    private void setAdapter(CorporaAdapter adapter) {
        if (adapter == mAdapter) return;
        if (mAdapter != null) mAdapter.close();
        mAdapter = adapter;
        mCorpusGrid.setAdapter(mAdapter);
    } 
 
    private QsbApplication getQsbApplication() { 
        return QsbApplication.get(getContext());
    } 
 
    protected void selectCorpus(Corpus corpus) {
        dismiss();
        if (mListener != null) {
            String corpusName = corpus == null ? null : corpus.getName();
            mListener.onCorpusSelected(corpusName);
        } 
    } 
 
    private class CorpusClickListener implements AdapterView.OnItemClickListener {