class - how to display items one after one in custom layout using Asynocronous task in android -
i creating 1 layout in code retrieve message string , image using webservices retrieve data in background process display data total views display 1 time ,
my intension getting 1 message string , 1 image getting after display custom layout next getting another(second) message string , image display add layout functionality running 1 one show messages , images
xmlfile:
<framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/framelayout1" android:layout_width="fill_parent" android:background="@android:color/white" android:layout_height="fill_parent"> <scrollview android:id="@+id/scrollview1" android:layout_height="wrap_content" android:layout_width="fill_parent"> </scrollview> </framelayout> code file :
public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); scrollview scrollview = (scrollview) findviewbyid(r.id.scrollview1); linearlayout toplinearlayout = new linearlayout(this); toplinearlayout.setorientation(linearlayout.vertical); (int = 0; < 15; i++){ linearlayout linearlayout = new linearlayout(this); linearlayout.setorientation(linearlayout.horizontal); imageview imageview = new imageview (this); textview textview = new textview (this); imageview.setimageresource(r.drawable.image); textview.settext("text view #" + i); linearlayout.addview(imageview); linearlayout.addview(textview); toplinearlayout.addview(linearlayout); } scrollview.addview(toplinearlayout); } how can display image , message in custom layout 1 after 1 in dynamically please forward solution thank in advance
using asynronous task in u r application update ui http://developer.android.com/reference/android/os/asynctask.html
Comments
Post a Comment