Search code examples
androidviewlockscreen

Android Adding View to the Lock Screen


I am working on a project where I need to modify the Lock Screen and add my View on it. I was reading the question Lock Screen Widget but this is based on adding widget to the lock screen .

Is it possible if we can add our own view to the Lock Screen like displaying my name on the lock screen as a TextView (below the security container or between the widget view and security container).

It will be very helpful if I can find any documentation or reference, till now I am only trying to understand the code in which they have widget container and security container but not sure how to add my view in it and not sure what all thing I need to consider before adding my view.
Any guidance/suggestion would be highly appreciated!
Working on Android 4.2


Solution

  • Is it possible if we can add our own view to the Lock Screen like displaying my name on the lock screen as a TextView (below the security container or between the widget view and security container).

    Assuming that you have some way to determine "my name", you can implement an app widget and indicate that it should be an option for the user to display on the lockscreen, on Android 4.2+.

    You can read more about writing app widgets in the Android developer documentation, particularly the section on writing lockscreen widgets. This sample project implements an app widget that can go on the home screen or on the lockscreen.