button in a listview need focus

Tutorials with advanced 'difficulty' and more Lines of Code.

button in a listview need focus

Postby ycnano » Thu Apr 08, 2010 6:35 am

Hello,

I am having trouble providing focus onto button listview element button while I use trackball to scroll down the list.
I have used custom adapter and binded view.
Every list has two button and several text msgs.
While I use the trackball I get the focus in the list view as hole but while I try to get the focus onto the button I am not able to get it.
I have used <button><requestFocus/></button>
and also tried using linearlayout.setOnchangeFocusListener to provide the focus.

I really need some solution on it.

Any help on it would be real grateful!!

Re,
Yc
ycnano
Freshman
Freshman
 
Posts: 5
Joined: Tue Mar 30, 2010 7:03 pm

Top

Postby Skeniver » Thu Apr 08, 2010 12:26 pm

Hey yanano

Use
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public void setItemsCanFocus (boolean itemsCanFocus)
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Here is the developer docs:
http://goo.gl/Z7oD

Bear in mind though, either the ListView is focusable or item within it are. If you make a button in a listview focusable, you won't be able to click the listview anymore! Check out these threads for more info:
http://goo.gl/56A3
http://goo.gl/MQ99

Hope this helps,
Neil
Follow me on twitter -> http://twitter.com/Skeniver
Apps & blog -> http://www.formidableapps.co.uk
User avatar
Skeniver
Senior Developer
Senior Developer
 
Posts: 106
Joined: Tue Feb 03, 2009 3:51 pm
Location: Canterbury, UK

Postby ycnano » Thu Apr 08, 2010 5:15 pm

Thanks Neil,
This was helpful.

Re,
Yc
ycnano
Freshman
Freshman
 
Posts: 5
Joined: Tue Mar 30, 2010 7:03 pm

Top

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests