Back to project page SQLite-Simple-Android.
The source code is released under:
Apache License
If you think the Android project SQLite-Simple-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package garin.artemiy.sqlitesimple.example.adapters; //w ww . ja v a2s . c o m import android.annotation.SuppressLint; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import garin.artemiy.sqlitesimple.R; import garin.artemiy.sqlitesimple.example.dao.RecordsDAO; import garin.artemiy.sqlitesimple.example.models.Record; import garin.artemiy.sqlitesimple.library.model.FTSModel; /** * Author: Artemiy Garin * Date: 07.04.13 */ @SuppressWarnings("CanBeFinal") public class FTSAdapter extends ArrayAdapter<FTSModel> { private RecordsDAO recordsDAO; public FTSAdapter(Context context, RecordsDAO recordsDAO) { super(context, R.layout.item_record); this.recordsDAO = recordsDAO; } @SuppressLint("InflateParams") @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_record, null); FTSModel ftsModel = getItem(position); TextView recordText = (TextView) convertView.findViewById(R.id.recordTextView); Record record = recordsDAO.readWhere(Record.COLUMN_ID, ftsModel.getId()); if (record != null) recordText.setText(record.getRecordText()); return convertView; } }