Hi!

Here is the focus change handler I wrote for an AutoCompleteTextView.
Now my problem is that whenever, the view loses focus, it does not
display content in the box. However, when I switch back to
AutoCompleteTextView it starts displaying it. I think this is a wrong
behaviour. Any comments.

Regards
Nitin
HSC

uri_box.setOnFocusChangeListener(new OnFocusChangeListener(){
                        public void onFocusChanged(View v, boolean hasFocus)
            {
                                if (hasFocus)
                                {
                                        AutoCompleteTextView uri_box = 
(AutoCompleteTextView)v;
                                        String st = 
uri_box.getText().toString().trim();
                                if (st.compareToIgnoreCase("Address") == 0)
                                {
                                        uri_box.setText("");
                                }
                                }
                                else
                                {
                                        AutoCompleteTextView uri_box = 
(AutoCompleteTextView)v;
                                        if 
(uri_box.getText().toString().trim().length() == 0)
                                        {
                                                uri_box.setText("Address");
                                        }
                                }
            }}
                );
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to