I am making a search engine for my Android app that involves a database. My current implementation is as follows:
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.result_item, R.id.txtVerbName, verbs);
AutoCompleteTextView txtSearch = (AutoCompleteTextView) findViewById(R.id.txtSearch);
txtSearch.setAdapter(adapter);
However, you will notice I have put “txtVerbName” (which is a TextView) as the textview that gets its value changed with the array attached (“verbs”). How can I make this work so that I can attach a value to txtVerbName and then also attach a different value to another textview in the same layout?
Use a Custom Adapter to accomplish this:
}