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

SMPN 1 BANDAR PACITAN ( smp negeri 1 bandar pacitan)

Daftar Nama Kecamatan Kelurahan/Desa & Kodepos Di Kota/Kabupaten Pacitan Jawa Timur (Jatim)