Home > Back-end >  Under the android lock screen to continue running
Under the android lock screen to continue running

Time:09-20

Themselves made android APP XE10 is learning, but do half of the time, found that as long as the phone lock screen, or return to the desktop, program continues to run for a few seconds and then stopped, can be said to be suspended, open interface to continue again, I want to do things, want to be in lock screen time can continue to work, online to find information, said most of them were sent to the background, the measured, but running in the background function, just show desktop, did not want to effect, and masters, tell it, set up there? Below is made a test function,
Procedure TForm1. Button3Click (Sender: TObject);

The begin
TThread. CreateAnonymousThread (procedure ()
Var
I: Integer;
The begin
For I:=1 to 10000000 do
The begin
TThread Synchronize (TThread CurrentThread,
Procedure ()
The begin
Form1. Memo1. Text:=inttostr (I);
End);
end;
The end). Start;
end;
Looked at interface, increasing Numbers of change, strives for the lock screen to work Settings or method, way,

CodePudding user response:

Join wake lock (WakeLock) authority, the authority can keep CPU have been active in the lock screen, it's power consumption, execution of the timely release, Samples, Object Pascal, Multi - the IDE Device Samples \ Google Glass directory in the case of a power management unit for reference, try to make it Services (Service) program, such as long running state of Services can be set to the front desk, in the Samples, the Object Pascal, Multi - Device Samples \ Device Sensors and Services have more than one Service program, for example, the help index are Creating Android Services items, including detailed steps,

CodePudding user response:

Leave a paw print 666666666666666666666666
  • Related