PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
[WINDEV MOBILE 19] Desativar a proteção de tela no Android
[WINDEV MOBILE 19] Desativar a proteção de tela no Android
Started by pedrosao, Feb., 21 2015 2:52 AM - No answer
Connect yourself…
pedrosao
#1
Registered member
42 messages
Popularité : +7 (7 votes)
Posted on February, 21 2015 - 2:52 AM
Muitas vezes precisamos desativar o Bloqueio de Tela nos dispositivos Android.
Abaixo um pequeno código para resolver isso.
//Desativar Bloqueio de Tela, protecao de tela, hibernar
import android.app.Activity
;
import android.view.Window
;
import android.view.WindowManager.LayoutParams
;
PUBLIC static
void DesativarBloqueioTela
(
boolean
keepScreenOn
) {
Activity xa
=
getCurrentActivity
(
)
;
Window xw
=
xa.getWindow
(
)
;
IF
(
keepScreenOn
=
=
True
) {
xw.addFlags
(
android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
)
;
}
ELSE
{
xw.clearFlags
(
android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
)
;
}
}
Report
1
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text