title: variable auto-refresh xamarin android
body: <p>I have a (strange) problem on my activity, when i pass from one activity to another (create map --> play), i save a copy (the original map) of my "state" variable (in OnCreate method) for restore it when the user will click the "restart" button (the original "state" variable is edited during the execution of the activity). But inexplicably (for me) the copy variable is updated like the original. What is the mistake??</p>
  
  <pre><code>int[,] state = new int[10,10];
  
  protected override void OnCreate(Bundle savedInstanceState)
      {
          base.OnCreate(savedInstanceState);
          SetContentView(Resource.Layout.step_by_step);
          int[] array = Intent.GetIntArrayExtra("arrayintero");
          //re-convert the array in 2D-array
          int[,] initial = new int[10, 10];
          int conta = 0;
          for (int i = 0; i &lt; 10; i++)
          {
              for (int j = 0; j &lt; 10; j++)
              {
                  state[i, j] = array[conta]
                  conta++;
              }
          }
          //initial is the copy variable
          initial = state;
          //update the map
          update_draw(buttonArray, state);
  
          //when the restart button is clicked
          restart.Click += delegate
          { 
              Toast.MakeText(this, "restart", ToastLength.Short).Show();
              //restore the map 
              update_draw(buttonArray, initial);
              //update the original variable
              state = initial;                
          };
  </code></pre>