Add delay textwatcher autocomplete android

new TextWatcher(){
    long lastPress = 0l;
    @Override
    public void onTextChanged(CharSequence s,
             int start, int before, int count){
        if(System.currentTimeMillis() - lastpress > 500){
            lastPress= System.currentTimeMillis();
            GetAutocompletion ac = new GetAutocompletion();
            ac.execute(zipBox.getText().toString());
        }
    }
    // Other methods to implement
}

ref : http://stackoverflow.com/questions/20761113/autocompletion-delay

Popular posts from this blog

Menampilkan tanggal fastreport delphi

Android C2DM (Cloud to Device Message) adalah

Menambahkan data pada TreeView delphi dari database mysql