ArrayAdapter clear - 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 clear method.

This code example shows how to use the following methods:addAll, clear
		} 
	} 
 
	public void setListContent(List<RssItem> result) {
		ArrayAdapter listAdapter = (ArrayAdapter) getListAdapter();
		listAdapter.clear();
		listAdapter.addAll(result);
		parseTask.setFragment(null);
		parseTask = null;
	} 
 
	public interface OnItemSelectedListener { 
		public void onRssItemSelected(String link);
	} 
 
	@Override 
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		if (activity instanceof OnItemSelectedListener) {
			listener = (OnItemSelectedListener) activity;
7
CodeRank
This code example shows how to use the following methods:addAll, clear
		} 
	} 
 
	public void setListContent(List<RssItem> result) {
		ArrayAdapter listAdapter = (ArrayAdapter) getListAdapter();
		listAdapter.clear();
		listAdapter.addAll(result);
		parseTask.setFragment(null);
		parseTask = null;
	} 
 
	public interface OnItemSelectedListener { 
		public void onRssItemSelected(String link);
	} 
 
	@Override 
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		if (activity instanceof OnItemSelectedListener) {
			listener = (OnItemSelectedListener) activity;
6
CodeRank
This code example shows how to use the following methods:clear
import android.widget.BaseAdapter; 
 
public class SeparatedListAdapter extends BaseAdapter {
    public void clear() { 
        sections.clear();
        headers.clear();
        notifyDataSetChanged();
    } 
 
    public final Map<String,Adapter> sections = new LinkedHashMap<String,Adapter>();
    public final ArrayAdapter<String> headers;
    public final static int TYPE_SECTION_HEADER = 0;
 
    public SeparatedListAdapter(Context context) {
        headers = new ArrayAdapter<String>(context, R.layout.list_header);
    } 
 
    public void addSection(String section, Adapter adapter) {
        this.headers.add(section);
        this.sections.put(section, adapter);
6
CodeRank
This code example shows how to use the following methods:clear
        this.view = view;
    } 
 
    @Override 
    public void onConnecting() { 
        adapter.clear();
        view.hideError();
        view.showProgress();
    } 
 
    @Override 
    public void onConnected() { 
        view.hideProgress();
    } 
 
    @Override 
    public void onError() { 
        view.hideProgress();
        view.showError();
    } 
5
CodeRank
This code example shows how to use the following methods:clear
         */ 
        return empty;
    } 
 
    public void clear() { 
        adapter.clear();
        prefs.edit().clear().commit();
        empty = true;
    } 
 
    public void save() { 
        prefs.edit().putStrings(prefsKey, getHistory()).commit();
    } 
} 
4
CodeRank
This code example shows how to use the following methods:clear
    public void button_delete(View v) {
 
    } 
 
    public void button_clear(View v) {
        mAdapter.clear();
    } 
 
    public void done(View v) {
 
        Intent intent = new Intent();
        intent.putExtra("data", mStrings);
        setResult(RESULT_OK,intent);
 
        finish();
 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:clear
			adapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1);
		} 
		 
		@Override 
		protected void onPreExecute(){ 
			adapter.clear();	
		} 
		 
		@Override 
		protected void onPostExecute(String result){
			//Process the suggestions received from the API 
			 
		} 
	} 
	 
	 
	 
} 
5
CodeRank
This code example shows how to use the following methods:clear
            } 
        } 
    } 
 
    public void clear() { 
        headers.clear();
        sections.clear();
        notifyDataSetInvalidated();
    } 
 
    @Override 
    public Object getItem(int position) {
        for (Object section : this.sections.keySet()) {
            Adapter adapter = sections.get(section);
            int size = adapter.getCount() + 1;
 
            // check if position inside this section 
            if (position == 0) return section;
            if (position < size) return adapter.getItem(position - 1);
 
4
CodeRank
This code example shows how to use the following methods:clear
			public void onTextChanged(CharSequence s, int start, int before, int count) {
				 
				if (((AutoCompleteTextView) tvAutoComplete).isPerformingCompletion()) {
		            return; 
		        } 
				adapter.clear();
				GetNateAutoComplete task  = new GetNateAutoComplete();
				task.execute(null, null, null);
			} 
		}); 
 
	} 
	 
	private class GetNateAutoComplete extends AsyncTask<Void, Void, ArrayList<String>> {
 
		@Override 
		protected ArrayList<String> doInBackground(Void... args) {
 
			ArrayList<String> predictionsArr = new ArrayList<String>();
 
4
CodeRank
This code example shows how to use the following methods:clear
		switch (item.getItemId()) {
		case 0: 
			((ArrayAdapter<String>)getListAdapter()).add("New Item");
			return true; 
		case 1: 
			((ArrayAdapter<String>)getListAdapter()).clear();			
			return true; 
		} 
		return false; 
	} 
} 
4
CodeRank

Related ArrayAdapter clear Questions & Answers:

clear Method Overview
Remove all elements from the list.
See Code Examples for other Android ArrayAdapter Methods: