Jump to content

filter d'un list avec un textwatcher

Recommended Posts


je ve faire une list filtrable par un textedit mais ce code ça marche pas

Cursor c2 = db.vaccinchild();
	final SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
			R.layout.vaccinlist, c2, new String[] { DBAdapter.doctor,
					DBAdapter.child_name, DBAdapter.date_received },
			new int[] { R.id.txtvaccin, R.id.txtchild, R.id.txtdate });
	EditText txtFilter = (EditText) findViewById(R.id.txtsearch);
	txtFilter.addTextChangedListener(new TextWatcher() {
		public void afterTextChanged(Editable s) {


		public void beforeTextChanged(CharSequence s, int start, int count,
				int after) {

		public void onTextChanged(CharSequence s, int start, int before,
				int count) {

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...