Search in sources :

Example 1 with SimpleCursorAdapter

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();
    }
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter)

Example 2 with SimpleCursorAdapter

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));
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter) Cursor(android.database.Cursor)

Example 3 with SimpleCursorAdapter

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);
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter)

Example 4 with SimpleCursorAdapter

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();
    }
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter)

Example 5 with SimpleCursorAdapter

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);
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter) Cursor(android.database.Cursor)

Aggregations

SimpleCursorAdapter (android.widget.SimpleCursorAdapter)60 Cursor (android.database.Cursor)37 ListAdapter (android.widget.ListAdapter)16 ListView (android.widget.ListView)13 AlphaAnimation (android.view.animation.AlphaAnimation)6 Animation (android.view.animation.Animation)6 AnimationSet (android.view.animation.AnimationSet)6 LayoutAnimationController (android.view.animation.LayoutAnimationController)6 TranslateAnimation (android.view.animation.TranslateAnimation)6 View (android.view.View)4 Test (org.junit.Test)3 Intent (android.content.Intent)2 Uri (android.net.Uri)2 TextView (android.widget.TextView)2 ContentResolver (android.content.ContentResolver)1 ContentValues (android.content.ContentValues)1 MatrixCursor (android.database.MatrixCursor)1 Drawable (android.graphics.drawable.Drawable)1 OnClickListener (android.view.View.OnClickListener)1 LayoutParams (android.view.ViewGroup.LayoutParams)1