Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I display the user's live wallpaper as background in my app?

I am creating a lockscreen replacement app for Android and would like to incorporate the user's currently selected wallpaper as my app's background. This is pretty easy to do for static background images, but I am not sure how to get a live wallpaper into my app. Is this possible?

like image 761
Jeremy White Avatar asked Dec 07 '14 22:12

Jeremy White


Video Answer


1 Answers

Yes, it's very easy. Add the following items to your theme:

<style name="MyAwesomeTheme" parent="@android:style/Theme.Holo.Or.Some.Other.Theme">
    <!-- your other theme items... 

    <!-- ADD THESE -->
    <item name="android:windowShowWallpaper">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
</style>

No other coding is necessary.

like image 122
Christian Göllner Avatar answered Sep 17 '22 22:09

Christian Göllner