title: Unable to change system time in android studio
body: <p>I was unable to change my system time( without using any UI) on my android app.</p>
  <p>The idea is:</p>
  <ol>
  <li>Retrieve current system time</li>
  <li>Switch current time forward and backward for a few hours( without using any UI)
  Note that the android app will be run in a root device.</li>
  </ol>
  <p>Below is my code:</p>
  <p>MainActivity.java</p>
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.activity_main);
          btn_open = findViewById(R.id.btn_startxk);
          btn_open.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  SimpleDateFormat simpdate = new SimpleDateFormat(&quot;yyyy-MM-dd HH:mm:ss&quot;);
                  Calendar cal = Calendar.getInstance();
                  String cur_time = simpdate.format(cal.getTime());
                  Toast.makeText(MainActivity.this, cur_time, Toast.LENGTH_LONG).show();
                  TimeManager timeManager = TimeManager.getInstance();
                  cal.set(Calendar.MILLISECOND, 0);
                  cal.set(Calendar.SECOND, 0);
                  cal.set(Calendar.MINUTE, 0);
                  cal.set(Calendar.HOUR_OF_DAY, 10);
                  long timeStamp = cal.getTimeInMillis();
                  timeManager.setTime(timeStamp);
  
      }
  </code></pre>
  <p>Could anyone help to correct my code?</p>