Android: Overlay TextView on LockScreen
<p><a href="https://i.stack.imgur.com/c8ltf.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/c8ltf.jpg" alt="Concept"></a></p>

<p>Im trying to overlay a TextView on top of the LockScreen (Similar to how Android Overlays the time).</p>

<p>Note: I dont want to by-pass the lockscreen, but just draw on top of it (without interfering with any of the touch events).</p>

<p>I've tried using the following flags (in onCreate):</p>

<pre><code>getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    getWindow().addFlags(WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);
    getWindow().addFlags(PixelFormat.TRANSLUCENT);
</code></pre>

<p>And applying the following Theme (to the specific activity): </p>

<pre><code>   &lt;style name="Transparent"&gt;
    &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt;
    &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt;
    &lt;item name="android:windowIsTranslucent"&gt;true&lt;/item&gt;
    &lt;item name="android:windowBackground"&gt;@android:color/transparent&lt;/item&gt;
    &lt;item name="android:windowActionBar"&gt;false&lt;/item&gt;
    &lt;item name="android:backgroundDimEnabled"&gt;false&lt;/item&gt;
 &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt;   
&lt;/style&gt;
</code></pre>

<p>But this draws on TOP of the lockscreen hiding the lockscreen and disabling all touch events. </p>

<p>Edit: <strong>activity_overlay.xml</strong></p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.coco.MainActivity" &gt;

&lt;TextView
    android:id="@+id/textView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textColor="@android:color/white"
    android:layout_alignParentBottom="true"
    android:text="TextView" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p><strong>Manifest declaration of Activity (which inflates overlay_activity.xml)</strong></p>

<pre><code>      &lt;activity
        android:name=".DisplayActivity"
        android:label="@string/app_name"
        android:theme="@style/Transparent" /&gt;
</code></pre>