use of android.widget.SimpleCursorAdapter in project cw-omnibus by commonsguy.
the class ConstantsFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(getActivity(), R.layout.row, current, new String[] { DatabaseHelper.TITLE, DatabaseHelper.VALUE }, new int[] { R.id.title, R.id.value }, 0);
setListAdapter(adapter);
if (current == null) {
db = new DatabaseHelper(getActivity());
task = new LoadCursorTask().execute();
}
}
use of android.widget.SimpleCursorAdapter in project cw-omnibus by commonsguy.
the class QuestionsFragment method onListItemClick.
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
SimpleCursorAdapter adapter = (SimpleCursorAdapter) getListAdapter();
Cursor row = (Cursor) adapter.getItem(position);
int link = row.getColumnIndex(DatabaseHelper.LINK);
((Contract) getActivity()).onQuestionClicked(row.getString(link));
}
use of android.widget.SimpleCursorAdapter in project cw-omnibus by commonsguy.
the class CallLogConsumerActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
adapter = new SimpleCursorAdapter(this, R.layout.row, null, new String[] { CallLog.Calls.NUMBER, CallLog.Calls.DATE }, new int[] { R.id.number, R.id.date }, 0);
adapter.setViewBinder(this);
setListAdapter(adapter);
getLoaderManager().initLoader(0, null, this);
}
use of android.widget.SimpleCursorAdapter in project cw-omnibus by commonsguy.
the class ConstantsFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(getActivity(), R.layout.row, current, new String[] { DatabaseHelper.TITLE, DatabaseHelper.VALUE }, new int[] { R.id.title, R.id.value }, 0);
setListAdapter(adapter);
if (current == null) {
db = new DatabaseHelper(getActivity());
task = new LoadCursorTask().execute();
}
}
use of android.widget.SimpleCursorAdapter in project cw-omnibus by commonsguy.
the class NewContactsAdapterBridge method buildPhonesAdapter.
SpinnerAdapter buildPhonesAdapter(Activity a) {
String[] PROJECTION = new String[] { Contacts._ID, Contacts.DISPLAY_NAME, Phone.NUMBER };
String[] ARGS = { String.valueOf(Phone.TYPE_MOBILE) };
Cursor c = a.managedQuery(Phone.CONTENT_URI, PROJECTION, Phone.TYPE + "=?", ARGS, Contacts.DISPLAY_NAME);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(a, android.R.layout.simple_spinner_item, c, new String[] { Contacts.DISPLAY_NAME }, new int[] { android.R.id.text1 });
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
return (adapter);
}
Aggregations