Gridview with listview inside android
<p>I have a view in my app where I have to display multiple listviews alongside each other, each containing data for a different user. So what I have done so far is I have a gridview with columns, and within each column I populate the gridview cell with a listview. This works fine, however, it displays the same listview twice, instead of displaying different listviews for each column. The strange thing is that if I replace the list view with a normal label, it displays the data from different users.</p>

<p>Main Activity where I set the gridview adapter: </p>

<pre><code>gridview.setNumColumns(10);
                gridview.setHorizontalSpacing(205);
                gridview.setStretchMode(0);
                gridview.setAdapter(new Adapter_Labels_GridView_Calendar_dayview(mContext, Session_CurrentSession.current_CALENDAR));
</code></pre>

<p>This is the adapter for the gridview... just the getview section. (You will see that is where I set the adapter for the listviews that displays the same listview and not different ones)</p>

<pre><code> public View getView(int position,View convertView, ViewGroup parent)
 {

  ListView list;

  if (convertView == null)
  {  
       // if it's not recycled, initialize some attributes  
       list = new ListView(mContext);
       list.setLayoutParams(new GridView.LayoutParams(150, 500));
       list.setPadding(2,2,2,2);
   }  
  else
  {  
       list = (ListView) convertView;  
  }  


  list.setAdapter(new Adapter_ListView_GridView_Calendar(mContext, dagtyeVanhaarkappers.get(position), gebookdeurUser.get(position), tekening.get(position)));
  list.setCacheColorHint(0);

  list.setId(position);

  list.setOnTouchListener(new View.OnTouchListener()
        {

            public boolean onTouch(View v, MotionEvent event)
            {   
                // Disallow the touch request for parent scroll on touch of child view
                v.getParent().requestDisallowInterceptTouchEvent(true);
                return false;
            }
        });

  return list;
 }  
</code></pre>

<p>}  </p>

<p>Thanks in Advance</p>

<p>EDIT:</p>

<p>Here is the gridview on touch event in the main activity:</p>

<pre><code>  gridview.setOnTouchListener(new View.OnTouchListener()
     {

            public boolean onTouch(View v, MotionEvent event)
            {
               if(isDayView &amp;&amp; created)
               {
                   int numchilds = gridview.getChildCount();
                   for(int i = 0; i &lt; numchilds; i++)
                   {
                       gridview.getChildAt(i).getParent().requestDisallowInterceptTouchEvent(false);

                   }
               }
                return false;
            }
        });
</code></pre>

<p>EDIT: getview of Adapter_ListView_GridView_Calendar</p>

<pre><code>        public View getView(int position, View convertView, ViewGroup parent)
    {

            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.row_bookingslist, parent , false);

            ImageView booking_image = (ImageView) rowView.findViewById(R.id.booking_image);
    TextView textBookingTime = (TextView) rowView.findViewById(R.id.booking_time);
    TextView textBookingUser = (TextView) rowView.findViewById(R.id.booking_byuser);

            booking_image.setImageDrawable(drawables.get(position));
            textBookingTime.setText(daytimes.get(position));
            textBookingUser.setText(bookedbyuser.get(position));


    return rowView;
}
</code></pre>

<p><strong>ANSWER FINALLY:</strong></p>

<p>I've found the problem... I thought the problem was with the adapter because of my weird view (Listview inside gridview)... However, I was not making new instances of the data when reading them into an arraylist using a for loop, so the string had the same reference in memory. Thus, when modyfying either one, I was actually modyfying the same instance of that object. Damn, can't beleive I did not see such a simple little thing. Thank You for all the help.</p>
