ArrayAdapter getFilter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ArrayAdapter getFilter method.

This code example shows how to use the following methods:getFilter
		filterEditText.addTextChangedListener(new TextWatcher() {
 
			@Override 
			public void onTextChanged(CharSequence s, int start, int before,
					int count) {
				adapter.getFilter().filter(s.toString());
			} 
 
			@Override 
			public void beforeTextChanged(CharSequence s, int start, int count,
					int after) {
			} 
 
			@Override 
			public void afterTextChanged(Editable s) {
			} 
		}); 
	} 
 
	private List<String> getModel() {
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getFilter
    	super.onPause(); 
    	// ATTENTION: need to do to closure of the keyboard when you click on home 
    	if (searchMenuItem.isActionViewExpanded()) {
    		searchMenuItem.collapseActionView();
    		// reset filter 
		mArrayAdapter.getFilter().filter(null);
    	} 
    } 
 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
    	searchMenuItem = CollapsibleMenuUtils.addSearchMenuItem(menu, true, textWatcher);
        return true; 
    } 
     
    private TextWatcher textWatcher = new TextWatcher() {
		 
		@Override 
		public void onTextChanged(CharSequence s, int start, int before, int count) { 
			mArrayAdapter.getFilter().filter(s); 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getFilter
			int after) {
	} 
 
	public void onTextChanged(CharSequence s, int start, int before,
			int count) {
		adapter.getFilter().filter(s);
	} 
 
} 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getFilter
		 
		linkSearchInput.addTextChangedListener(new TextWatcher() {
		    @Override 
		    public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
		        // When user changes the Text 
		        adapter.getFilter().filter(cs);  
		    } 
		    @Override 
		    public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
		            int arg3) { }
		    @Override public void afterTextChanged(Editable arg0) { }
		}); 
		 
		listview.setAdapter(adapter);
 
		listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
			@Override 
			public void onItemClick(AdapterView<?> parent, final View view,
					int position, long id) {
				final String item = (String) parent.getItemAtPosition(position);
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getFilter
	 * @see android.text.TextWatcher#afterTextChanged(android.text.Editable) 
	 */ 
	@Override 
	public void afterTextChanged(Editable prefix) {
		if (getFilterableArrayAdapter() != null) { 
			getFilterableArrayAdapter().getFilter().filter(prefix);
			doAfterTextChanged(prefix.toString());
		} 
	} 
	 
	public void doAfterTextChanged(String prefix) {
		// Do Nothing 
	} 
	 
	/** 
	 * @return The {@link ArrayAdapter} of the list to filter. 
	 */ 
	public abstract ArrayAdapter<T> getFilterableArrayAdapter();
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getFilter
        listViewCountries.setAdapter(adapter);
    } 
 
    @Override 
    public void onTextChanged(CharSequence s, int start, int before, int count) {
        adapter.getFilter().filter(s);
    } 
 
    @Override 
    public void afterTextChanged(Editable s) {}
     
    @Override 
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related ArrayAdapter getFilter Questions & Answers:

Other ArrayAdapter getFilter Examples

51:				public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
52:					// When user changed the Text
53:					MainActivity.this.adapter.getFilter().filter(cs);	
54:				}
55:

Read More

getFilter Method Overview
Returns a filter that can be used to constrain data with a filtering pattern.
See Code Examples for other Android ArrayAdapter Methods: