安卓ICS原生锁屏 [英] Android ICS native lockscreen

查看:154
本文介绍了安卓ICS原生锁屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找的SW在过去的2天,谷歌等。我正在寻找一种方式来实现自带的锁屏,如下面的屏幕上显示一个原生的Andr​​oid ICS的活动。 这些画面来自播放器专业版但我注意到,也有其他球员( PlayerPro 为例)具有相同的功能,看起来完全一样的,这就是为什么我认为这是本土的东西,或者至少,有实现它的常用方法。

I've been looking for the past 2 days on SW, google and so on. I'm looking for a way to implement an activity that comes with the native Android ICS lockscreen as the one shown in the screens below. Those screens come from Player Pro but I noticed that also other players ( PlayerPro for instance ) have the same feature that looks exactly the same, that's why i think it's something native or at least, there is a common way to implement it.

到目前为止,我只设法获取和活动的替代使用这些标志的锁屏:

So far I only managed to get and Activity that replace the lockscreen using these flags:

  • WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
  • WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
  • WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
  • WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD

对这些事件BroadCaseReciever:

with a BroadCaseReciever on these events:

  • Intent.ACTION_SCREEN_ON
  • Intent.ACTION_SCREEN_OFF
  • Intent.ACTION_USER_ preSENT
  • Intent.ACTION_SCREEN_ON
  • Intent.ACTION_SCREEN_OFF
  • Intent.ACTION_USER_PRESENT

我的问题是,我想我的活动,以显示与锁屏而不是取代它。难道你们知道如何实现这一目标?

My problem is that i want my activity to be shown with the lockscreen not replacing it. Do you guys know how to achieve this?

是有原生的隐藏API来做到这一点?

is there a native-hidden API to do this?

你们可以联系我实现这个特定的功能的一些示例?

can you guys link me some sample that implement this particular feature?

在此先感谢;)

推荐答案

我想你可能会寻找音频控制远程视图(RemoteControlClient)API中的Andr​​oid 4.0(API级别14)补充说。我发现 RemoteControlClient API 在Android开发者文档是:

I think you might be looking for the Audio Controls "remote view" (RemoteControlClient) API added in Android 4.0 (API level 14). I found the RemoteControlClient API in the Android developer docs that:

使得消费意味着公开信息   通过能够显示的元数据,艺术品和媒体遥控器   控制键。

enables exposing information meant to be consumed by remote controls capable of displaying metadata, artwork and media transport control buttons.

(这是有联系过此页面的。)

注:我从来没有使用这个API自己,所以如果这不会为你工作,我表示歉意。

Note: I have never used this API myself, so I apologize if this does not work for you.

这篇关于安卓ICS原生锁屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆