use of de.baumann.browser.View.CompleteAdapter in project browser by scoute-dich.
the class BrowserActivity method updateAutoComplete.
@Override
public void updateAutoComplete() {
RecordAction action = new RecordAction(this);
action.open(false);
List<Record> list = action.listBookmarks();
list.addAll(action.listHistory());
action.close();
CompleteAdapter adapter = new CompleteAdapter(this, list);
inputBox.setAdapter(adapter);
adapter.notifyDataSetChanged();
inputBox.setDropDownWidth(ViewUnit.getWindowWidth(this));
inputBox.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String url = ((TextView) view.findViewById(R.id.record_item_url)).getText().toString();
inputBox.setText(url);
inputBox.setSelection(url.length());
updateAlbum(url);
hideSoftInput(inputBox);
}
});
}
Aggregations