Code example for ArrayAdapter

Methods: insertremove

0
        String inputWord = etInputWord.getText().toString();
        if (inputWord.equals("")) {
            return; 
        } 
 
        mAdapter.remove(inputWord);     // delete a duplicate word
        mAdapter.insert(inputWord,0);
 
    } 
 
    @Override 
    protected void onPause(){ 
        super.onPause(); 
        mCsv.copyArrayAdapterToCsv(mAdapter,WORDLIST_FILENAME,1,this);
    } 
 
    @Override 
    protected void onDestroy(){ 
        super.onDestroy(); 
        mCsv.close();
    }