Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
Application.ProcessMessages in Android
#1
Hello

why "Application.ProcessMessages" not work in Android?
Vi Project Management[url=https://useviapp.com][/url]
WWW
Cevapla
#2
ProcessMessages allows the jobs waiting in the queue to be temporarily transferred to the main thread by leaving the current thread. 
I do not recommend using ProcessMessages in FMX Multi-platform architecture. Instead of ProcessMessages, write small subroutines. Synchronize or queue each subroutine in a new thread.
Begin : = end / 2;
Cevapla
#3
(04-12-2020, Saat: 12:57)RAD Coder Adlı Kullanıcıdan Alıntı: ProcessMessages allows the jobs waiting in the queue to be temporarily transferred to the main thread by leaving the current thread. 
I do not recommend using ProcessMessages in FMX Multi-platform architecture. Instead of ProcessMessages, write small subroutines. Synchronize or queue each subroutine in a new thread.
Yes I khow but Embarcadero use it!

See FMX.Ani

class procedure TAnimator.AnimateIntWait(const Target: TFmxObject; const APropertyName: string; const NewValue: Integer;
 Duration: Single = 0.2; AType: TAnimationType = TAnimationType.In;
 AInterpolation: TInterpolationType = TInterpolationType.Linear);
var
 Animation: TIntAnimation;
begin
 StopPropertyAnimation(Target, APropertyName);

 Animation := TIntAnimation.Create(nil);
 try
   Animation.Parent := Target;
   Animation.AnimationType := AType;
   Animation.Interpolation := AInterpolation;
   Animation.Duration := Duration;
   Animation.PropertyName := APropertyName;
   Animation.StartFromCurrent := True;
   Animation.StopValue := NewValue;
   Animation.Start;
   while Animation.FRunning do
   begin
     Application.ProcessMessages;
     Sleep(0);
   end;
 finally
   Animation.DisposeOf;
 end;
end;


I use AnimateIntWait in project , in windows run correct but in android UI don`t response to user because use "Application.ProcessMessages;"

Your comment was edited because it contains invalid code formatting. Please use code formatting in code shares!
Vi Project Management[url=https://useviapp.com][/url]
WWW
Cevapla
#4
(04-12-2020, Saat: 12:32)gbg Adlı Kullanıcıdan Alıntı: Hello

why "Application.ProcessMessages" not work in Android?

Hi,

You can find official answers on this topic here, unfortunately, for now you have to move forward with other solutions.

Good work.
Cevapla
#5
but "Application.ProcessMessages" work in Android with D10.2
Vi Project Management[url=https://useviapp.com][/url]
WWW
Cevapla
#6
You can use the following workaround with Delphi 10.4.
  TThread.CreateAnonymousThread(
   procedure
   begin
     TAnimator.AnimateFloat(Arc1, 'EndAngle', 360, 1.3);
     TThread.Sleep(13 * 100);
     TAnimator.AnimateFloat(Arc1, 'EndAngle', 0, 1.3);
   end).Start;


Begin : = end / 2;
Cevapla
#7
(04-12-2020, Saat: 17:04)RAD Coder Adlı Kullanıcıdan Alıntı: You can use the following workaround with Delphi 10.4.
  TThread.CreateAnonymousThread(
   procedure
   begin
     TAnimator.AnimateFloat(Arc1, 'EndAngle', 360, 1.3);
     TThread.Sleep(13 * 100);
     TAnimator.AnimateFloat(Arc1, 'EndAngle', 0, 1.3);
   end).Start;

Thanks
But I need to wait in the main thread
I have a CriticalSection and I want the main thread to wait for the end
Vi Project Management[url=https://useviapp.com][/url]
WWW
Cevapla


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
  Android 16 Uygulama Ekran Taşma Sorunu[ÇÖZÜLDÜ] codder71 5 1.075 31-07-2026, Saat: 23:38
Son Yorum: mcuyan
  Delphi FMX - Modern Android Bileşen ve Tema Yapılandırması | Rehber Mr.X 0 477 29-06-2026, Saat: 13:44
Son Yorum: Mr.X
  Android Uygulama İkonu ARM 2 818 11-11-2025, Saat: 12:15
Son Yorum: ARM
  Android SDK kajmerantime 1 687 28-10-2025, Saat: 14:53
Son Yorum: cinarbil
  Android El Terminali Barkod Okuyucu Verisi tuna 0 563 17-10-2025, Saat: 01:07
Son Yorum: tuna



Konuyu Okuyanlar: 1 Ziyaretçi