title: How-to use Runnable in Mono for android
body: <p>I'm try to lern Monodroid! I try to re-write java code to C# and have some problem: I don't understand how-to use Runnable.
  That's snipet of code in Java, that I coudn't translate to C#:</p>
  
  <pre><code>public class RunActivity extends Activity implements OnClickListener
  {
     ...
  
     private Handler mHandler;
  
     @Override
     public void onCreate(Bundle savedInstanceState)
     {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.run);
         ... 
         mHandler = new Handler();
         mHandler.postDelayed(mUpdateGeneration, 1000);
     }
  
     private Runnable mUpdateGeneration = new Runnable()
     {
         public void run()
         {
            mAdapter.next();
            mLifeGrid.setAdapter(mAdapter);
  
            mHandler.postDelayed(mUpdateGeneration, 1000);
         }
     }; 
     ...
  </code></pre>
  
  <p>Can you explain me how I must write this code and use Runnable? 
  This Runnable use for update gridview adapter and load data from adapter to gridview in background. If I tried update adapter in main thread? like this(C# code):</p>
  
  <pre><code>mAdapter.next()
  mLifeGrid.Adapter = mAdapter;
  Thread.Sleep(1000);
  </code></pre>
  
  <p>Activity is stuck.
  If I can't use Runnable, how can I implement updating of adapter and gridview in new thread?
  If I use C# threading, like this:</p>
  
  <pre><code>...
  Thread th = new Thread(new ThreadStart(mUpdatGeneration));
  th.Start();
  }
  public void mUpdateGeneration()
  {
      mAdapter.next()
      mLifeGrid.Adapter = mAdapter;
      Thread.Sleep(1000);
  }
  </code></pre>
  
  <p>it generates an error "System.NullReferenceException"</p>
  
  <p>Thanks to all for any help! 
  P.S. Sorry for my English :)</p>