AutoCompleteTextView があり、CursorAdapter を取得しました。で使用するとすべてが正常に機能するようになりましandroid.R.layout.simple_dropdown_item_1line
たが、カスタム レイアウトを膨らませようとした瞬間に Android が諦めてしまいます。
作品
@Override
public void bindView(View view, Context context, Cursor cursor) {
final String text = convertToString(cursor);
((TextView) view).setText(text);
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
final LayoutInflater inflater = LayoutInflater.from(context);
final View view =
inflater.inflate(
android.R.layout.simple_dropdown_item_1line,
parent, false);
return view;
}
動作しません
@Override
public void bindView(View view, Context context, Cursor cursor) {
final String text = convertToString(cursor);
((TextView) findViewById(R.id.txtAutoCompleteText)).setText(text);
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
final LayoutInflater inflater = LayoutInflater.from(context);
final View view =
inflater.inflate(
//android.R.layout.simple_dropdown_item_1line,
R.layout.auto_complete_item,
parent, false);
return view;
}
誰かがすでに同様の質問をしており、回答済みとしてマークされていることは知っていますが、それは私の質問を満たしていません。
私が欠けているものはありますか、それともこれは不可能です。