title: Android: Increase height of linear layout while adding ImageViews to it
body: <p>I am trying to add ImageViews by drag and drop to a LinearLayout. After adding 5 ImageViews, the LinearLayout size should increase and the ImageViews should add in the Next line of the LinerLayout. Basically I am trying to add 5 sets of ImageViews in the LinearLayout. First 5 in first line, Next 5 in 2nd line etc... </p>
  
  <p>Any idea how to achieve this. I tried it in the following manner but the imageviews are not added after increasing the height of the LinerLayout.</p>
  
  <pre><code>case DragEvent.ACTION_DROP:
  
              if(v == findViewById(R.id.dragDropHereLinear)) {
                  View view = (View) event.getLocalState();
                  ViewGroup viewgroup = (ViewGroup) view.getParent();
                  //viewgroup.removeView(view);                   
  
                  ImageView iv = new ImageView(getApplicationContext());
  
  
                  LinearLayout containView = (LinearLayout) v;
  
                  TextView textView = (TextView) findViewById(R.id.tvDragDropHere);
  
                  if(count &gt; 4 ) {
                      count = 0;
                      containView.getLayoutParams().height = containView.getLayoutParams().height + 200;
                      containView.requestLayout();
                      //invalidate();
                  }                   
  
                  iv.setPadding(5, 0, 5, 0);
                  containView.addView(iv);
                  iv.setVisibility(View.VISIBLE);
                  view.setVisibility(View.VISIBLE);
                  count++;
  
              } else {
                  View view = (View) event.getLocalState();
                  view.setVisibility(View.VISIBLE);
                  Context context = getApplicationContext();
                  Toast.makeText(getApplicationContext(), "problem in dropping the image", 
                          Toast.LENGTH_LONG).show();
              }
              break;
  </code></pre>