code: private void setValues(int position, Button view) {
          if (position == 10) {
              view.setText("0");
          } else if (position == 9) {
              view.setVisibility(View.INVISIBLE);
          } else {
              view.setText(String.valueOf((position + 1) % 10));
          }
      }
docs: Setting Button text
  @param position Position of Button in GridView
  @param view Button itself