LinearLayout append new childs on refresh?
<p>aim facing a problem with appending new childs when recall the function , my problem is when i remove a child from layout and click on reload button its wont append the removed child , the function call childs from db and append them into LinearLayout .</p>

<p>this function called on Activity start and on update button </p>

<p>i want to re append removed childs again how !</p>

<pre><code>public void reload_files_list() {

    datasource.open(); 

    //get all files from database
    Sql_var[]  allfiles = datasource.selectAll();

    //get mother parnet for files
    filesMother = (LinearLayout) findViewById(R.id.linare_layout_files);

    filesMother.invalidate();
    filesMother.refreshDrawableState();

    imgLoader = new ImageLoader(BabupMyFiles.this);
    String imagezwe = "jpg";

    if ( allfiles.length &gt; 0 ) {    
        while( fi &lt; allfiles.length ) {
            int myid = (int) allfiles[fi].getId();
            String filename = allfiles[fi].true_name();
            String download_path = allfiles[fi].download_path();
            String type = allfiles[fi].type();
            String ext = allfiles[fi].ext();
            String submiteddate = allfiles[fi].timestamp_date();
            String size = allfiles[fi].size();

            inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            final View child = inflater.inflate(R.layout.file_bit_loop, null);

            if ( ext.indexOf("jpg") != -1  ) {
                ImageView imgView;
                imgView = (ImageView)child.findViewById(R.id.filepicture);
                imgLoader.DisplayImage(download_path, imgView);
            }

            ImageView downloaded = (ImageView)child.findViewById(R.id.downloaded);

            File checkexists = new File(allfiles[fi].local());

            //file downloaded icons
            if ( checkexists.exists() == true) {
                downloaded.setVisibility(View.VISIBLE);
            } else {
                downloaded.setVisibility(View.INVISIBLE);
            }

            //file size
            TextView fileize = (TextView)child.findViewById(R.id.fileize);
            fileize.setText( size );

            //file size
            TextView filedate = (TextView)child.findViewById(R.id.filedate);
            filedate.setText( submiteddate+ " " +myid );

            //file name
            TextView title = (TextView)child.findViewById(R.id.filename);
            title.setText( filename );

            child.setId(myid);

            ((View) child).setOnClickListener(onClickListener);

            ((LinearLayout) filesMother).addView(child);

            fi++;
        }   
    }
}
</code></pre>
