Friday, June 4, 2010

[android-developers] Re: How to get the screen lock status

Thanks for your response. However, as you can see the moment the user
wake up the screen but before the user slide the lock key, I would
like to know if the phone is in this state or not. As far as I can
tell, the onVisibilityChanged will send me a "true" status as soon as
the user wake up the screen. I would like to be notified or a query
API that I can tell if the phone has been unlocked (after user slide
the lock button over).

On Jun 4, 7:17 am, Dmitry Suzdalev <dim...@gmail.com> wrote:
> On Friday 04 June 2010 17:44:19 ubuntu_user wrote:
>
> > I am looking for a method to get the current screen lock status. I
> > would like to know if it is locked or not. I have a live wall paper
> > that only need to work if the screen is unlock (i.e. full display is
> > on), otherwise, it should be just blank.
>
> You should just reimplement
> WallpaperService::Engine::onVisibilityChanged(bool) inside your live
> wallpaper's engine - this will tell you when wallpaper gets shown/hidden.
>
> It's better to use this method, because you don't need to do anything not only
> if screen is locked, but e.g. when some other app starts and wallpaper isn't
> visible.
>
> onVisibilityChanged is exactly what you need  in this case :)
>
> Seehttp://developer.android.com/reference/android/service/wallpaper/Wall...)
>
> Cheers,
> Dmitry.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment