简体   繁体   English

对于android如何创建设备主题而非应用主题?

[英]For android How to create device theme NOT app theme?

I know about creating theme for android app , but I don't know how to create a theme for the android system itself which is the theme that contains icons styles and wallpaper...etc . 我知道为Android应用程序创建主题,但是我不知道如何为android系统本身创建主题,该主题包含图标样式和墙纸...等。 I have searched a lot but I found nothing on that topic , so I appreciate answering my question. 我进行了很多搜索,但未找到关于该主题的任何内容,因此感谢您回答我的问题。 Thanks in advance. 提前致谢。

You can start by creating an activity to replace default home screen as following in your app manifest.xml 您可以从创建一个活动来替换默认主屏幕开始,如下所示,在您的应用manifest.xml中

<activity android:name="ah.hathi.simplelauncher.HomeActivity" android:label="Simple Launcher Home" android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen" android:launchMode="singleTask" android:stateNotNeeded="true" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
</activity>

By adding the categories android.intent.category.HOME and android.intent.category.DEFAULT to the intent-filter group, when users click on home button, they will be asked to choose between default launcher or your activity. 通过将类别android.intent.category.HOME和android.intent.category.DEFAULT添加到intent-filter组,当用户单击home按钮时,将要求他们在默认启动器或您的活动之间进行选择。 So you can custom your launcher activity as whatever you want. 因此,您可以根据需要自定义启动器活动。

The details could be found here : build a custom launcher on android 可以在这里找到详细信息: 在android上构建自定义启动器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM