Question: 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](https://play.google.com/store/apps/details?id=com.tbig.playerpro&hl=it) but I noticed that also other players ( [PlayerPro](https://play.google.com/store/apps/details?id=com.tbig.playerpro&hl=it) 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`

with a BroadCaseReciever on these events:

* `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?

is there a native-hidden API to do this?

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

thanks in advance ;)

![enter image description here](https://i.stack.imgur.com/7bqKJ.png)
![enter image description here](https://i.stack.imgur.com/5AR2e.png)
![enter image description here](https://i.stack.imgur.com/GGaMZ.png)

Answer: 
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](http://developer.android.com/reference/android/media/RemoteControlClient.html) 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.
> 
> 
> 

(It was linked off of [this page](http://developer.android.com/resources/samples/RandomMusicPlayer/index.html).)

Note: I have never used this API myself, so I apologize if this does not work for you.
You're almost doing it right. Keep doing what you do with the BroadcastReceiver. That's the way to go. For the Window, these are the flags you need to use:

* WindowManager.LayoutParams.FLAG\_SHOW\_WHEN\_LOCKED
* WindowManager.LayoutParams.FLAG\_NOT\_TOUCH\_MODAL

Do ***not*** use FLAG\_DISMISS\_KEYGAURD

What these flags do: SHOW\_WHEN\_LOCKED allows your activity to show up on top of the lock screen. FLAG\_NOT\_TOUCH\_MODAL allows touch events that are not on your activity to go to the other activities, ie, allows the user to unlock the screen. FLAG\_DISMISS\_KEYGUARD gets rid of the lock screen, so we do not use it.

Define this style in your res/values/styles.xml file

```
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="Theme.FloatingTranslucent" parent="android:Theme.Translucent.NoTitleBar">
    <item name="android:windowIsFloating">true</item>
  </style>
</resources>

```

In your manifest, define your activity's style

```
<activity android:name=".SampleActivity" android:theme="@style/Theme.FloatingTranslucent">
...
</activity>

```

What this does is makes your activity completely see through and *wrap content*.

Now, your activity should be on top of the lock screen, allowing touch input to the lock screen and to your app, with your activity not full size.

Cheers.