前言
这是在新浪博客的时候遗留的问题,一个是添加注册机制,一个是添加启动Splash,这篇写完了就完结了。本片还是以SuperChm为例。
准备DEMO:网路上的cnblogs.com 稍作了修改
对象:SuperChm
目的:添加Splash到SuperChm
直接操作1、在AndroidManifest.xml的修改:
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:hardwareAccelerated="true" android:name="com.jrzheng.superchm.Activity.MainActivity">
<intent-filter>
<action android:name="com.google.app.splashy.CLEARSPLASH"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:label="@string/app_name" android:name="com.jrzheng.superchm.Activity.SplashyDemo" android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
也就是添加“.SplashyDemo”为主Activity,并向原主Activity传入特定的 intent 组件;
2、\res\values\public.xml 添加:
<public type="layout" name="splash" id="0x*****" />
<public type="id" name="img1" id="0x*****" />
\res\values\ids.xml 添加:
<item type="id" name="img1">false</item>
R$layout 添加:
.field public static final splash:I = 0x*****
R$id 添加:
.field public static final img1:I = 0x*****
3、在 \res\drawable\ 文件夹下添加 splash.jpg
在 \res\layout\文件夹下添加:splash.xml
4、主Activity所在的文件夹下,添加 SplashyDemo.smali 和 SplashyDemo$1.smali ,将里面的 Lcnblogs/com/-->Lcom/jrzheng/superchm/Activity/ ;将 SplashyDemo.smali 文件中的 0x7f030001 换成 splash 的id即可。
相关下载
链接: http://pan.baidu.com/s/1kTLvpUf 密码: yxdv