android - how to fill in scroll view from file or database or any data source? -
i want bind data xml file? how can i'm using layout xml file define scrollview ??
if i've understood question right, want read layout file , insert scrollview.
you want take layoutinflater task. example doing activity.
layoutinflater inflater = (layoutinflater)context.getsystemservice(context.layout_inflater_service); scrollview sv = findviewbyid(r.id.id_of_scrollview); inflater.inflate(r.layout.id_of_layoutfile_to_include, sv);
edit: after having read comment realise misunderstood question.
scrollview not view want binding data, scrollview specialized framelayout, , therefore allows 1 child.
your looking view listview (which adds scrolling automatically)
another solution use layout in scrollview , dynamically (from code) add views.
linearlayout ll = findviewbyid(r.id.id_of_linearlayout); //loop data , build view each data entry , add ll.addview(yourview);
Comments
Post a Comment