I use in my program this rutine for lock and unlock screen, and it not go in my new Galaxy Note 2 with android 4.1.1
B4X:
Sub SetShowWhenLocked
Dim r As Reflector
r.Target = r.GetActivity
r.Target = r.RunMethod("getWindow")
r.RunMethod2("addFlags", 6815872, "java.lang.int")
End Sub
Yes, i think that there is some change in android 4.1.1 or is a problem only of Galaxy Note 2... if anyone can probe this method in other device with 4.1.1... or if anyone know other method for unlock screen.
Thanks.
SOLVED:
In my application i use this code
B4X:
Sub Activity_Resume 'Ejecuta esta rutina cuando despertamos el equipo.
If CheckBox2.Checked = True Then
ShowWhenLocked("addFlags") 'Una vez que logramos activar la pantalla, esta rutina muestra lo que hay debajo de la pantalla de bloqueo, o sea nuestro programa.
Timer2.Initialize("Timer2", 10000)'Tras estos 10 seg se permite que el equipo se ponga en reposo de nuevo.
Timer2.Enabled = True
End If
End Sub
I dont know whats happens that now when i do ShowWhenLocked("addFlags") launch event Activity_Pause and after Activity_Resume, so i add this code to my program
B4X:
Sub Activity_Pause (UserClosed As Boolean) 'Ejecuta esta rutina justo antes de abandonar el programa.
If CheckBox2.Checked = True Then ShowWhenLocked("addFlags")
TTS1.Release
Awake.ReleaseKeepAlive
End Sub
With this add code now my device wakeup perfect for me.