Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while deploying sample code by android, project:android api demos

Tags:

android

I am getting following error on deploying one of the sample projects given by android: android api demos for api level 8 :

error: Error retrieving parent for item: No resource found that matches the given name 'android:style/Theme.Wallpaper'.

at values/styles.xml line 43

<style name="Theme.Wallpaper" parent="android:style/Theme.Wallpaper">
    <item name="android:colorForeground">#fff</item>
</style>

I have been looking for solutions for over a month now. I have tried rebuilding project, dowloading entire source code again and rebuilding and cleaning. Help

like image 718
harshit Avatar asked Oct 15 '12 04:10

harshit


2 Answers

As Very Well Explain by raychenon.

<style name="Theme.Wallpaper" parent="android:style/Theme.Wallpaper" >
    <item name="android:colorForeground">#fff</item>
</style>

What is happening is that some styles, like Theme.Wallpaper are not public. You should not extend from them anymore.

Some suggest to revert to platform_tools_r05 HERE

If you want to do the correct way read Xavier July 28 HERE

If you wish to reuse a style that is private, you should copy the content of that style into your own instead of extending it.

ANSWER

Default theme for windows that want to have the user's selected wallpaper appear behind them.

<style name="Theme.Wallpaper">
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:colorBackgroundCacheHint">@null</item>
    <item name="android:windowShowWallpaper">true</item>
</style>

Looks like you want to use the above code from the Android source and create your own theme based it.

Hope it Will Helps you.

like image 103
Bhavesh Patadiya Avatar answered Nov 20 '22 00:11

Bhavesh Patadiya


You can refer to this question posted here and read Xavier's comments on the Google blog..

style reference after SDK and ADT plugin update in mid 2011

Hope it helps..Keep me posted

like image 39
anz Avatar answered Nov 19 '22 23:11

anz