use of framework.db.SqlBean in project AndroidDevelop by 7449.
the class SearchActivity method startDialog.
private void startDialog() {
List<SqlBean> fictionNameAll = GreenDaoDbUtils.getFictionNameAll();
View view = View.inflate(getApplicationContext(), R.layout.dialog_search, null);
editText = (EditText) view.findViewById(R.id.search_et);
final FlowLayout flowLayout = (FlowLayout) view.findViewById(R.id.flow);
flowLayout.removeAllViews();
alertDialog = new AlertDialog.Builder(this).setTitle(getString(R.string.fiction_name)).setView(view).setNegativeButton(getString(R.string.dialog_unok), null).setPositiveButton(getString(R.string.dialog_ok), this).create();
alertDialog.show();
for (int i = 0; i < fictionNameAll.size(); i++) {
FlowText textView = new FlowText(flowLayout.getContext());
textView.setText(fictionNameAll.get(i).getTitle());
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FlowText flowText = (FlowText) v;
fictionName = flowText.getText().toString().trim();
startNetWork();
alertDialog.dismiss();
}
});
flowLayout.addView(textView);
}
editText.setOnFocusChangeListener(this);
}
Aggregations