質問

私はカスタムDataAdaptorからListViewを入力しています。ListViewの各項目/行ごとにレイアウトが定義されています。そのリストビューには、AutoCompleTextViewがあります。SQLiteデータベースからデータとバインドする必要があります。実際にはこのAutoCompleteTextViewはカテゴリを一覧表示し、これらのカテゴリはSQLite Table.Iから来ています。

カテゴリが各行で同じままであるため、取得したい データベースから一度だけカテゴリを使用して、 各行のAutoCompleTextView

誰かが私にそれをする方法を導いてもらえますか?

雑談

役に立ちましたか?

解決

To avoid multiple database calls ..

You can fetch data in cursor from database in your activity's onCreate() then using CursorAdapter or SimpleCursorAdapter bind it (using setAdapter) to AutoCOmpleteTextView in your list Adapter's getView()..

This example will help you lot Using AutocompleteTextView with SQLite and CursorAdapter

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top