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:
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
Post a Comment