2012. 9. 1. 12:44
안드로이드 - autocompletetextview customize 안드로이드 이야기2012. 9. 1. 12:44
728x90
반응형
안드로이드 - autocompletetextview customize
What I've done so far is storing tags in a dedicated sqlite3 table. Tags are queried resulting in a Cursor. The Cursor is passed to a SimpleCursorAdapter which looks like this:
Cursor cursor = dbHelper.getAllTags();
startManagingCursor(cursor);
String[] columns = new String[] { TagsDB._TAG};
int[] to = new int[] { R.id.tv_tags};
SimpleCursorAdapter cursAdapt = new SimpleCursorAdapter(this, R.layout.tags_row, cursor, columns, to);
actv.setAdapter(cursAdapt);
As you can see I created tags_row.xml which looks like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:paddingLeft="4dip" android:paddingRight="4dip"
android:orientation="horizontal">
<TextView android:id="@+id/tv_tags" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1"
android:textColor="#000" android:onClick="actv_item_click" />
<CheckBox android:id="@+id/cb_tags" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:onClick="actv_item_checked" />
</LinearLayout>
It looks like this:
728x90
반응형
'안드로이드 이야기' 카테고리의 다른 글
안드로이드 - autocompletetextview 커스텀마이징 (0) | 2012.09.01 |
---|---|
안드로이드 - Customizing AutoCompleteTextView to display images and text in the suggestion list using SimpleAdapter in Android (2) | 2012.09.01 |
Android - AlarmManager (0) | 2012.08.30 |
안드로이드 - 근접센서 간단 예제 (0) | 2012.08.29 |
안드로이드 - 기기의 마이크로 들어오는 소리의 데시벨을 구하는 방법 (0) | 2012.08.29 |