Wallpaper介绍一个Activity如何通过Style把系统Wallpaper作为当前Activity的背景。

这是WallpaperActivity在AndroidManifest.xml中的定义:

        <activity android:name=".app.WallpaperActivity"                android:label="@string/activity_wallpaper"                android:theme="@style/Theme.Wallpaper">            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.SAMPLE_CODE" />            </intent-filter>        </activity>

@style/Theme.Wallpaper定义如下:继承系统android:style/Theme.Wallpaper,并将前景色设为白色(这里是文字的颜色)

    <!-- A theme that has a wallpaper background.  Here we explicitly specify         that this theme is to inherit from the system's wallpaper theme,         which sets up various attributes correctly. -->    <style name="Theme.Wallpaper" parent="android:style/Theme.Wallpaper">        <item name="android:colorForeground">#fff</item>    </style>

【起航计划 016】2015 起航计划 Android APIDemo的魔鬼步伐 15 App->Activity->Wallpaper 系统壁纸作为当前Activity的背景

更多相关文章

  1. android 新闻系统客户端,服务器端采用JSP Servlet 实现
  2. 不能直接从eclipse拷贝源码到android系统中。
  3. android自学笔记《三》——系统架构分析
  4. android:背景选择器-selector
  5. Android中自定义属性的格式详解

随机推荐

  1. 使用ViewPager实现android软件使用向导的
  2. Android(安卓)最好用的模拟器 Genymotion
  3. Android@Home,会否一统家庭自动化产业标准
  4. 小羊驼和你一起学习cocos2d-x之六(lua、a
  5. Android(安卓)TextView等控件不为人知的
  6. 1.android开发AsyncTask异步发送HTTP请求
  7. [原创]HierarchyView的实现原理和Android
  8. Android(安卓)TextView设置多样式文本,跑
  9. Android中使用WindowManager在界面布局上
  10. Android中requestLayout、invalidate以及