android - How can I change the Background Resource from the first ListView visible Item? -


i'm noob @ java android.

i searched more question , found can use

listview.getfirstvisibleposition();

to first visible position. how can implement new background resource first visible position?

i tried far.

view = lv.getfirstvisibleposition()   get.setbackgroundresource(r.drawable.newconversation); 

thanks.

there method in adapter controls list items views

@override public view getview(int position, view convertview, viewgroup parent) { 

you can use condition :

if(position == 0) //set background 

after convertview has been inflated


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -