1、查找AndroidManifest.xml文件,软件进入运行,全屏且竖屏启动AppStartr activity
<activity android:name=".AppStart" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:screenOrientation="portrait">
<intent-filter></intent-filter>
2、在欢迎界面 net.oschina.app.AppStart有渐变显示启动屏
AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
aa.setDuration(2000);
view.startAnimation(aa);
aa.setAnimationListener(new AnimationListener()
{
@Override
public void onAnimationEnd(Animation arg0) {
redirectTo(); //监听一个事件,当动画结束的时,执行redirectTo().
}
@Override
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationStart(Animation animation) {}
});
3、跳转到main.class,不带任何参数
private void redirectTo(){
Intent intent = new Intent(this, Main.class);
startActivity(intent);
finish();
}
4、兼容低版本cookie(1.5版本以下,包括1.5.0,1.5.1)
AppContext appContext = (AppContext)getApplication();
String cookie = appContext.getProperty("cookie");
if(StringUtils.isEmpty(cookie)) { //commons-lang.jar有提供比较方便的方法处理字符串类型
String cookie_name = appContext.getProperty("cookie_name");
String cookie_value = appContext.getProperty("cookie_value");
if(!StringUtils.isEmpty(cookie_name) && !StringUtils.isEmpty(cookie_value)) {
cookie = cookie_name + "=" + cookie_value;
appContext.setProperty("cookie", cookie);
appContext.removeProperty("cookie_domain","cookie_name","cookie_value","cookie_version","cookie_path");
}
}
AppContext 全局应用程序类:用于保存和调用全局应用配置及访问网络数据
待续...