title: adding imageButtons by code
body: <p>I have a base adapter class  which i use to fill in a listview. Some of the contents are defined in a layout file and i also need to dynamically add in a certain number of image button depending on the int value passed to the base adapter.<br>
  The obj is a object that has the int value along with a arrayList of bitmaps;
  when i run this code i get more image buttons then the value of obj.value. 
  likePre_pics is the name of the arrayList of bitmaps
  Can someone please help?</p>
  
  <pre><code>      public class News_Feed_BaseAdapter extends BaseAdapter{
  
                        @Override
         public View getView(int position, View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
  
      LinearLayout linLayout =
      (LinearLayout)convertView.findViewById(R.id.like_preview_LinearLayout);
  
        for(int i=0; i&lt; obj.value;i++)
        {
            ImageButton op= new ImageButton(context);
  
            LayoutParams lpView = new LayoutParams(100, 100);
              //op.setImageBitmap(obj.get(position).likePre_pics.get(i));
  
               linLayout.addView(op,lpView);
  
        }
  
                  }
           }
  </code></pre>