Android Listview - Get item focused -


i have listview contains dynamic number of items. trying focused item in order position imageview accordingly.

here example positioning works on buttons:

enter image description here

    button1 = (button) findviewbyid(r.id.button1);     final imageview arrow = (imageview)findviewbyid(r.id.arrow);     final imageview arrow1 = (imageview)findviewbyid(r.id.arrow_1);         button1.setonfocuschangelistener(new view.onfocuschangelistener() {         @override         public void onfocuschange(view view, boolean b) {              relativelayout.layoutparams rlparams;             rlparams = new relativelayout.layoutparams(                     (int)relativelayout.layoutparams.wrap_content, (int)relativelayout.layoutparams.wrap_content);             rlparams.addrule(relativelayout.align_bottom, r.id.button1);             rlparams.setmargins(0,0,0,5);             arrow.setlayoutparams(rlparams);              relativelayout.layoutparams rlparams1;             rlparams1 = new relativelayout.layoutparams(                     (int)relativelayout.layoutparams.wrap_content, (int)relativelayout.layoutparams.wrap_content);             rlparams1.addrule(relativelayout.align_bottom, r.id.button1);             rlparams1.addrule(relativelayout.right_of,r.id.button1);             rlparams1.setmargins(10,0,0,5);              arrow1.setlayoutparams(rlparams1);           }     }); 

and same other buttons.

the problem method have specify id of view, in line:

rlparams.addrule(relativelayout.align_bottom, r.id.button1); 

so question is, how can on listview items? don't have id each item.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -