How to focus android activity to the specific item of the listview -


i populating listview dynamically want when activity created take focus specific item of listview. in facebook app notification takes on specific row of comments.

if listview extends activity try :

listviewname.setselection(positionofitem); 

and if listview extends listactivity try :

getlistview().setselection(positionofitem); 

example chat application, listview must focused @ last row put code after message displayed

getlistview().setselection(getlistadapter().getcount()-1); 

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -