Note that there are some explanatory texts on larger screens.

plurals
  1. POhow can implemented adding more views in dynamic layout implementing scrollview in android
    primarykey
    data
    text
    <p>i am implementing custom linearlayout in this adding more views retrieve database using webservices in back ground process all data are retrive messages and message related userimages also first initally loading messages after one by one loading images in custom linear layout </p> <p>main.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;FrameLayout android:id="@+id/frameLayout1" android:layout_width="fill_parent" android:background="@android:color/white" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent"&gt; &lt;ScrollView android:id="@+id/scrollView1" android:layout_height="wrap_content" android:layout_width="fill_parent"&gt; &lt;LinearLayout android:layout_width="fill_parent" android:id="@+id/linearLayout2" android:layout_height="fill_parent"&gt; &lt;LinearLayout android:layout_width="fill_parent" android:id="@+id/linearLayout3" android:layout_height="fill_parent"&gt; &lt;ImageView android:id="@+id/person" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/ImageView&gt; &lt;TextView android:textColor="@android:color/black" android:id="@+id/textView1" android:layout_height="wrap_content" android:layout_width="wrap_content"&gt;&lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; &lt;/FrameLayout&gt; </code></pre> <p>codefile:</p> <pre><code>public class MYlist extends Activity { /** Called when the activity is first created. */ List&lt;MessageClass&gt; messages; int i=0,n=5; ParseXMLString parse=new ParseXMLString(); DataParsingComm dataparsing=new DataParsingComm(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String xml="&lt;spGetUserMessages&gt;&lt;SearchLocation&gt;&lt;/SearchLocation&gt;&lt;LoginUserID&gt;125&lt;/LoginUserID&gt;&lt;/spGetUserMessages&gt;"; messages =parse.GetGetUserMessages(dataparsing.ILGetUserMessages(xml)); addElements(messages,i,n); } protected void addElements(final List&lt;MessageClass&gt; messages2,int i,int n) { int k=0; //((LinearLayout)findViewById(R.id.linearLayout1)).removeAllViews(); for(int i1=i;i1&lt;n;i1++) { LinearLayout ll1=((LinearLayout)findViewById(R.id.linearLayout2)); ll1.setBackgroundResource(R.drawable.tabmessage); Log.v("11111111","333"+ i1+ n); if(k==i1) { for(int j1=i1;j1&lt;n;j1++) { TextView msg=((TextView)findViewById(R.id.textView1)); msg.setText(messages2.get(j1).getmessage()); } } ImageView prsnImg=((ImageView)findViewById(R.id.person)); try{ String photoXml="&lt;spGetUserPhoto&gt;&lt;UserID&gt;125&lt;/UserID&gt;&lt;/spGetUserPhoto&gt;"; String photoInfoFromDB=new DataParsingComm().ILGetImage(photoXml); if(photoInfoFromDB.equalsIgnoreCase("anyType{}")||photoInfoFromDB.equals(null) ) { prsnImg.setImageResource(R.drawable.person); } else{ byte[] imgArry= Base64.decode(photoInfoFromDB); Bitmap bit=BitmapFactory.decodeByteArray(imgArry,0,imgArry.length); prsnImg.setImageBitmap(bit); } }catch (Exception e) { e.printStackTrace(); } finally { System.gc(); System.runFinalization(); } } } } </code></pre> <p>screenshot: <a href="http://www.freeimagehosting.net/uploads/8437c22cca.png" rel="nofollow">http://www.freeimagehosting.net/uploads/8437c22cca.png</a></p> <p>my problem is every time display one item all data override that single item view in layout how can implemented one by one display views in linear layout </p> <p>please tell me some solution thanks in advance </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload