How to place focus in child view of list row?

by Oleksiy Kokachev » Fri, 13 Mar 2009 01:42:35 GMT


Sponsored Links
 Hi..
I have ListView, where each row contains two edittext boxes. I'd like
on list item selected(using Dpad) place focus on first edittext box. I
tried the following code, but it does not work:
ListView list = (ListView) findViewById(R.id.list);
OnItemClickListener click_listener = new OnItemClickListener() {
                public void onItemClick(AdapterView<?> parent, View view, int
position, long id){
                        EditText box1 = (EditText)view.findViewById(R.id.box1);
                        box1.requestFocus();
                    return ;
                }

        };
        list.setOnItemClickListener(click_listener);
}

Any help is appreciated.

Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~



How to place focus in child view of list row?

by Oleksiy Kokachev » Fri, 13 Mar 2009 01:42:56 GMT


 Hi..
I have ListView, where each row contains two edittext boxes. I'd like
on list item selected(using Dpad) place focus on first edittext box. I
tried the following code, but it does not work:
ListView list = (ListView) findViewById(R.id.list);
OnItemClickListener click_listener = new OnItemClickListener() {
                public void onItemClick(AdapterView<?> parent, View view, int
position, long id){
                        EditText box1 = (EditText)view.findViewById(R.id.box1);
                        box1.requestFocus();
                    return ;
                }

        };
        list.setOnItemClickListener(click_listener);
}

Any help is appreciated.

Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. JSR - Does Android have a list of JSR's ?

Hi,

JSR - Does Android have a list of JSR's ?

Thanks
--~--~---------~--~----~------------~-------~--~----~

2. Android in the future

Hey,
Lately, I have been reading a lot of thoughts and reviews on the web
about Android OS and Android devices and many of them saying that
Android failed to catch the game with other players (iPhone, Palm
Pre).
Do you think the game is over for Android? does it still  has a future?
--~--~---------~--~----~------------~-------~--~----~

3. AudioRecord APIs

4. How to license Google Closed Source Apps for device

5. Null pointer exception while receiving at Broadcast receiver

6. DISABLE_DEXPREOPT ?

7. Have GET_INTENT_FILTERS been supported?