title: Refresh one grid view from another in android
body: <p>I am having a base adapter like below : </p>
  
  <pre><code>public class GridViewAdapter extends BaseAdapter {
  
  Context cont;
  ........
  
  @Override
  public View getView(int arg0, View convertView, ViewGroup arg2) {
  
      View v;
      TextView tv;
      GridItemObject itemObject = (Constants.gridItemsList.get(arg0));
      if (convertView == null) // if it’s not recycled, initialize some  attributes
      { 
          LayoutInflater li = (LayoutInflater) cont
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          v = li.inflate(R.layout.grid_item, null);
  
          tv = (TextView) v.findViewById(R.id.grid_item_textView1);
  
                      if(itemObject.isvisited)
                      {
                       tv.setText(itemObject.letter);
                      }
          }
  
      } 
      else 
      {
          v = (View) convertView;
      }
      return v;
  
  }
  </code></pre>
  
  <p>Constants.gridItemsList is a static list of type List &lt; GridItemObject > which has few items(text set from 1 to 10) initially set with isvisited property as false.</p>
  
  <p>The GridItemObject is a class which has definition as below : </p>
  
  <pre><code>    public class GridItemObject 
      {
        public String letter;
        public boolean isvisited;
      }
  </code></pre>
  
  <p>I want this gridview to be refreshed from another gridview which is as follows : </p>
  
  <pre><code>public class CustomGridViewAdapter extends BaseAdapter {
  
      Context cont;
      GridViewAdapter adapter;
      // setting the values in constructor....
  
      @Override
      public int getCount() {
      return 10;
      }
  
      @Override
      public View getView(int arg0, View convertView, ViewGroup arg2) {
      View v;
      TextView tv;
      LayoutInflater li = (LayoutInflater) cont
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          v = li.inflate(R.layout.numbers_grid_item, null);
  
          tv = (TextView) v.findViewById(R.id.numbers_grid_item_textView1); 
      tv.setText(arg0+"");
  
      tv.setOnClickListener(new OnClickListener() {
  
      @Override
      public void onClick(View arg0) {
        GridItemObject itemObject = (Constants.gridItemsList.get(arg0));
        itemObject.isvisited = true;
        adapter.notifyDataSetChanged();
      }
    });
  </code></pre>
  
  <p>I am using this gridview in my activity.</p>
  
  <p>The issue is, I am not able to refresh GridViewAdapter adapter from CustomGridViewAdapter.
  When i click an item in CustomGridViewAdapter's gridview and check what's happening all the numbers are jumbled.
  Could someone suggest me on how to refresh a gridview from another (while using custom adapters in <strong>seperate files</strong>)</p>