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>

更多相关文章

  1. android自定义属性之format介绍
  2. Android中使用XmlSerializer拼装XML数据
  3. Android实现手写板和涂鸦功能
  4. Android: 自定义Tab样式
  5. android背景选择器selector用法、自定义Button按钮样式.........
  6. Android在XML中自定义控件的使用
  7. Toolbar上overflow的样式自定义详解
  8. 使用valgrind检测Android(安卓)native程序的内存
  9. Android中自定义属性的格式详解

随机推荐

  1. [连载 1/15] Android 从入门到精通Exampl
  2. Android DownloadManager下载完成事件监
  3. android:visibility="gone"
  4. Android 利用shape自定义进度条样式
  5. android adb pm命令
  6. Android Gradle基础实践
  7. android 二级菜单、双ListView 仿美团、
  8. Android的屏幕适配问题(Phone、Pad)
  9. [Android Pro] android 混淆文件project.
  10. Android单个进程内存分配策略