Dynamic layouy creation image source from web
<p>here is my problem</p>

<p>i have to create a layout which take image source from web for image view in 
onCreat() method. the problem is that the creation of the view is taking very much time 
and the black screen is appearing before the creation of activity
i cant use ASYNCTASK class as it runs on UI thread and i am finding difficulty 
using requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS)
also. i am also attaching the snippet for reference do find me any work around 
and any progress bar solution that avoids the black screen is also appreciated</p>

<pre><code>LinearLayout main;
ArrayList&lt;ArrayList&lt;String&gt;&gt; v3=new ArrayList&lt;ArrayList&lt;String&gt;&gt;();
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.abc);
</code></pre>

<p>main=(LinearLayout)findViewById(R.id.main);</p>

<p>for(int i=0;i&lt;=v3.size()-1;i++){</p>

<pre><code>        l1=new LinearLayout(Chat.this);
        l1.setId(Integer.valueOf(v3.get(i).get(1)));
        TextView tv1 = null;
        l1.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
        l1.setOrientation(LinearLayout.VERTICAL);
        l1.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {

            }
        });
        LinearLayout l2=new LinearLayout(Chat.this);
        LinearLayout.LayoutParams innerHorizontalLinearLayout= new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
        innerHorizontalLinearLayout.setMargins(10, 10, 0, 0);
        l2.setLayoutParams(innerHorizontalLinearLayout);
        l2.setOrientation(LinearLayout.HORIZONTAL);
        ImageView imageView1= new ImageView(Chat.this);
        imageView1.setLayoutParams(new LayoutParams(70, 90));
        imageView1.setScaleType(ImageView.ScaleType.CENTER_CROP);
        try{
            Log.i("finding bug","finding bug5");
            URL newurl = new URL("xyz"+v3.get(i).get(4)+"");
            Log.i("newurl",""+newurl);
            Bitmap  mIcon_val = BitmapFactory.decodeStream(newurl.openConnection() .getInputStream());
            if (null != mIcon_val){
                imageView1.setImageBitmap(mIcon_val);
            }else{
                Log.i("The Bitmap is NULL","");
            }
             tv1=new TextView(Chat.this);
            LinearLayout.LayoutParams lp1= new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
            lp1.setMargins(15, 0, 0, 0);
            tv1.setLayoutParams(lp1);
            String s2="\n"
            if(identity.contains("pat")){
            tv1.setText(Html.fromHtml("&lt;span style:margin-bottom:10px;&gt;&lt;b&gt;" + v3.get(i).get(3) +s2+ "&lt;/b&gt;&lt;/span&gt;" +  "&lt;br /&gt;" + 
                    "&lt;small&gt;" + v3.get(i).get(5)+s2+"&lt;/small&gt;&lt;br/&gt;"+
                    "&lt;small&gt;"+l1.getId()+v3.get(i).get(2)+"&lt;/small&gt;"));
            }
            if(identity.contains("doc")){
                tv1.setText(Html.fromHtml("&lt;span style:margin-bottom:10px;&gt;&lt;b&gt;" + v3.get(i).get(3) +s2+ "&lt;/b&gt;&lt;/span&gt;" +  "&lt;br /&gt;" + 
                        "&lt;small&gt;" +l1.getId()+ v3.get(i).get(2)+"&lt;/small&gt;"));
            }
            }catch(Exception e){
                Log.i(" catch in getting profile pic",""+e+"");
            }
        l2.addView(imageView1);
        l2.addView(tv1);
        l1.addView(l2);
        main.addView(l1);
    }    
</code></pre>

<p>any suggestion or work around(wi) thanks in advance</p>
