Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mAutoComp.addTextChangedListener(new TextWatcher() {
- public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}
- public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {}
- public void afterTextChanged(Editable editable) {
- mProgressCircle.setVisibility(View.VISIBLE);
- new Thread(new Runnable() {
- public void run() {
- mAddressAdapter.update(mAutoComp.getText().toString(), new AddressAdapter.Refreshable(){
- public void refresh(int type) {
- switch(type){
- case PROGRESS_AWAY:
- runOnUiThread(new Runnable() {
- public void run() {
- mProgressCircle.setVisibility(View.INVISIBLE);
- }
- });
- break;
- case UPDATE_DATA:
- runOnUiThread(new Runnable() {
- public void run() {
- mAddressAdapter.refreshData();
- }
- });
- }
- }
- });
- }}).start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement