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

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -