Android Question stop the screen saving and bring the aplication in foreground

Ran Espensen

Member
Licensed User
Longtime User
Hi,

Is it possible in an application to stop the screen saving and bring the aplication in foreground display


I making an app to a handicapped person who can not touch the screen so the app must automatically remove the screen saver, and display in foreground.

I have tried a keepalive, but then I get a empty the battery werry soon.


? And how ?

Thanks for your answers
Ran
 

Ran Espensen

Member
Licensed User
Longtime User
Yes
I have service running that have to start main app and send it to foreground, but the screen saver is displayd and i have to remove sleep screen, the user cant ttoutch the screen because off his handicap.
So i need to remove the sleep screen and send main display to front.

Thanks
Ran
 
Upvote 0

Ran Espensen

Member
Licensed User
Longtime User
Hi Erel
When screen saver is active, callsub from er service do not start, in this example i have a screensaver to 15 seconds, and
CallSubDelayed(Main,"SetShowWhenLocked") will first be aktivatet when screen saver is removed..

I have the service running over night and 7 in then morning it starts main, by calling CallSubDelayed(Main,"SetShowWhenLocked") , butt.
screensaver locks for running the sub.

I tryed to make a sub in a bas module,, but dont work.

Regands
Ran
 

Attachments

  • Screen.zip
    2 KB · Views: 209
Upvote 0

Ran Espensen

Member
Licensed User
Longtime User
Hi

I use StartsActivity, and then call sub.,,

Sub T1_Tick
Dim NowHouer As Int
NowHouer = DateTime.GetHour(DateTime.Now)
If NowHouer > 7 Then 'it is morning i must unlock the screen, and show main app
T1.Enabled=False
WS.KeepAlive(True)
'''If IsPaused(Main) Then
''' StartActivity("Main")
'''End If
StartActivity("Main") ' changed after your treed
CallSubDelayed(Main,"MainBeep")
''problem
''Main is paused, and callsub waits until pause screen is removed...

CallSubDelayed(Main,"SetShowWhenLocked")
CallSubDelayed(Main,"MainBeep")
ToastMessageShow("Wake up in then morning and remove lock screen",True)
End If
End Sub

Regards Ran
 
Upvote 0

Ran Espensen

Member
Licensed User
Longtime User
Hi again

Sorry but it doesent work, WS.KeepAlive(True) turns the screen light on, but the pause screen is stil active, i have to wipe the screen and after that resume is activatet.

My user is disabled and can not touch the screen, to remove the pause screen.

I tested sleep and resume, dont work.

I need at call directly from the Service Module, to remove the pause screen

Regards
Ran
 
Upvote 0

Ran Espensen

Member
Licensed User
Longtime User
Problem solved..

Dim r as global and update r in main before sleep and moved this to the Service Activity

Main.r.RunMethod2("addFlags", 6815872, "java.lang.int")
Before StartActivity "Main"

Thaks for your help
Ran
 
Upvote 0
Top