@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
String key = String.valueOf(queryDate.getText());
searchAnswerByDate(key);
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
public void back_main(View view){
onBackPressed();
}
public void getBooks(){
booksRecycler = findViewById(R.id.listBook);
dbHelper = new DBHelper(this);
booksRecycler.hasFixedSize();
booksRecycler.setLayoutManager(new LinearLayoutManager(this));
list_book = dbHelper.list_book();
adapter = new Adapter(list_book , this);
booksRecycler.setAdapter(adapter);
}
public void searchAnswer(String key){
booksRecycler = findViewById(R.id.listBook);
dbHelper = new DBHelper(this);
booksRecycler.hasFixedSize();
booksRecycler.setLayoutManager(new LinearLayoutManager(this));
search = dbHelper.search(key);
adapter = new Adapter(search , this);
booksRecycler.setAdapter(adapter);
}
public void searchAnswerByDate(String key){
booksRecycler = findViewById(R.id.listBook);
dbHelper = new DBHelper(this);
booksRecycler.hasFixedSize();
booksRecycler.setLayoutManager(new LinearLayoutManager(this));
search = dbHelper.searchByDate(key);
adapter = new Adapter(search , this);
booksRecycler.setAdapter(adapter);
}
}
Do'stlaringiz bilan baham: |