android - Getting View from RelativeLayout -
programatically have relativelayout
, textview
(called title) within defined follows:
relativelayout layout = new relativelayout(this); final relativelayout.layoutparams parameters_title = new relativelayout.layoutparams(relativelayout.layoutparams.wrap_content, relativelayout.layoutparams.wrap_content); title.setlayoutparams(parameters_title); layout.addview(title,parameters_title);
i intend add more textviews
, buttons
later. now, want "convert" (i not sure how put words) relativelayout
view
in order put windowmanager
. trying use layoutinflater
wouldn't work
layoutinflater layoutinflater = (layoutinflater)this.getsystemservice(context.layout_inflater_service); myview = layoutinflater.inflate(layout, null );
then goal put myview
windowmanger
through addview
. how can view
relativelayout
?
relativelayout
extends viewgroup
has getchildcount()
, getchildat(int index)
methods. try :
for(int i=0;i<relativelayout.getchildcount();i++){ view child=relativelayout.getchildat(i); //your processing.... }
Comments
Post a Comment