title: Delphi 10.4 FMX App replacing Application.ProcessMessage() with Thread
body: <p>I am trying to run a simple example Delphi 10.4 FMX program that does away with <code>Application.ProcessMessages()</code> as suggested by <a href="https://stackoverflow.com/questions/58775196/">Android and Application.ProcessMessages</a> and <a href="https://en.delphipraxis.net/topic/658-does-applicationprocessmessages-behaviour-differ-between-vcl-and-fmx/" rel="nofollow noreferrer">Does application.processmessages behaviour differ between VCL and FMX?</a>.</p>
  <p>The button simply updates the label 3 times. Following <a href="https://blog.marcocantu.com/blog/2014_may_background_delphi_android_threads.html" rel="nofollow noreferrer">Background Operations on Delphi Android, with Threads and Timers</a>, it works as expected with one level, but not two levels of change.</p>
  <p>Can someone point out what I am doing wrong?  I have left the code with <code>Application.ProcessMessages()</code> to show the desired effect.</p>
  <pre class="lang-pascal prettyprint-override"><code>function Measure1sec(wait: integer): boolean;
  var
    sw: TStopwatch;
  begin
    sw := TStopwatch.StartNew;
    while sw.ElapsedMilliseconds &lt; wait do sw.ElapsedMilliseconds;
    Result := TRUE;
  end;
      
  procedure TForm1.EndProgress(Sender: TObject);
  var
    Thread: TThread;
  begin
    Measure1sec(500);
    label1.text := 'orange';
  end;
      
  procedure TForm1.Button1Click(Sender: TObject);
  var
    Thread: TThread;
  begin
    {
    //////////////////  Using Application.ProcessMessages //////////////
    label1.text := 'apple';
    // Application.ProcessMessages;   // with this works without not
    Measure1sec(500);
    label1.text := 'orange';
    // Application.ProcessMessages;   // with this works without not
    Measure1sec(500);
    label1.text := 'done';
    // Application.ProcessMessages;   // with this works without not
    Measure1sec(500);
    }
      
    //////////////////  Using Threads //////////////////////////////////
    Thread := TThread.CreateAnonymousThread(
      procedure
      begin
        TThread.Synchronize(TThread.Current,
          procedure
          begin
            label1.text := 'apple';
          end
        );
      end
    );
    Thread.OnTerminate := EndProgress;
    Thread.Start;
  end;
  </code></pre>