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

This code example shows how to use the following methods:getItem, insert, remove
        this.headers.add(section);  
        this.sections.put(section, adapter);  
    }   
 
    public void setSectionTitle(int section, String title) {
    	String oldTitle = this.headers.getItem(section);
 
    	// remove/add to headers array 
    	this.headers.remove(oldTitle);
    	this.headers.insert(title, section);
    	 
    	// remove/add to section map 
    	Adapter adapter = this.sections.get(oldTitle);
    	this.sections.remove(oldTitle);
    	this.sections.put(title, adapter);
    } 
     
    public Object getItem(int position) {  
        for(int i = 0; i < headers.getCount(); i++) {
        	String section = headers.getItem(i);
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:insert, remove
        empty = list.isEmpty();
    } 
 
    public void add(String historyItem) {
        // make sure that we do not end up inserting duplicates 
        adapter.remove(historyItem);
        adapter.insert(historyItem, 0);
        empty = false;
    } 
 
    public ArrayAdapter<String> getAdapter() {
        return adapter;
    } 
 
    public List<String> getHistory() {
        return listAdapter;
    } 
 
    public boolean isEmpty() { 
        /* 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:insert, remove
		// If the completion was already there, remove and re-add it. This way, 
		// it gets moved to the front. 
		int previousLocation = completionOptions.indexOf(s);
		if (previousLocation != -1) {
			completionOptions.remove(previousLocation);
			arrayAdapter.remove(s);
		} 
 
		// Add our completion to the actual active completions database 
		arrayAdapter.insert(s, 0);
 
		// Add our completion to our to-be-persistent storage 
		completionOptions.add(0, s);
 
		Log.d(TAG, "Current completion options: " + completionOptions.toString());
	} 
 
	public void clearCompletionOptions(SharedPreferences settings) {
		completionOptions.clear();
		savePersistentState(settings);
5
CodeRank
Experience pair programming with AI  Get Codota for Java
insert Method Overview
Inserts the specified object at the specified index in the array.
See Code Examples for other Android ArrayAdapter Methods: