title: gridview setNotifiedDataSetChanged() not updating gridview smoothly?
body: <p>I try to update gridview background color smoothly but it does not work somoothly.
  when i scrool gridview at that time it get changed; plz guide me how to do it, below is my code, Thanks you.</p>
  
  <pre><code>TableGridViewAdapter gridadapter;
   GridView gridview;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState); 
  
              textViewUname = (TextView) this.findViewById(R.id.userName);
              textViewUname.setText("Welcome , " + HomeActivity.name);
  
               gridview = (GridView) findViewById(R.id.gridview);
               gridadapter=new TableGridViewAdapter(this);
               gridview.setAdapter(gridadapter);
              //adapter.notifyDataSetChanged();            
  
               UpdateGridview updateGridview=new UpdateGridview();
               updateGridview.execute(TableActivity.this);
  
  
  
              // code for onClick gridview items , It take to that Activity
              gridview.setOnItemClickListener(new OnItemClickListener() {
  
                  @Override
                  public void onItemClick(AdapterView&lt;?&gt; parent, View v,
                          int position, long id) {
                      ConText.currentPos = position;
                      Intent i = new Intent(TableActivity.this,
                              OrderListActivity.class);
                      i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                              | Intent.FLAG_ACTIVITY_CLEAR_TOP);
                      startActivity(i);
                      finish();
  
                  }
  
              });
          } 
      }
  
  }
  </code></pre>
  
  <p>here i tryed to refreshing view in every 20sec</p>
  
  <pre><code>  private class UpdateGridview extends AsyncTask&lt;Context, Integer, String&gt;
         {    
          @Override
          protected String doInBackground( Context... params ) 
          {
  
                  int i = 0;
                  while( i &lt;10) 
                  {
                          try{
  
                                 gridadapter.notifyDataSetChanged();
                                // gridadapter.refreshItems(gridadapter);
                                 gridview.invalidate();
  
                                //TableGridViewAdapter.refreshItems(gridadapter);
                                 Thread.sleep( 20000 );
                                 System.out.println("i  called notifyDataSetChanged()=======================");
                                  i++;
                          } catch( Exception e ){
                                  Log.i("makemachine", e.getMessage() );
                          }
                  }
                  return "COMPLETE!";
          }
  
  // -- gets called just before thread begins
          @Override
          protected void onPreExecute() 
          {
                  Log.i( "makemachine", "onPreExecute()" );
                  super.onPreExecute();
  
          }
  
  
          @Override
          protected void onProgressUpdate(Integer... values) 
          {
                  super.onProgressUpdate(values);
  
          }
  
          // -- called if the cancel button is pressed
          @Override
          protected void onCancelled()
          {
                  super.onCancelled();
                 Log.i( "makemachine", "onCancelled()" );
  
          }
  
          // -- called as soon as doInBackground method completes
          // -- notice that the third param gets passed to this method
          @Override
          protected void onPostExecute( String result ) 
          {
                  super.onPostExecute(result);
                  Log.i( "makemachine", "onPostExecute(): " + result );
  
          }
  </code></pre>
  
  <p>}</p>
  
  <p>}</p>