当我启动我的应用程序时,我会先看到一个白屏几秒钟,然后才会出现启动画面。我想知道我的应用程序大小是否会影响它(它是17.7MB)?还是因为我的测试设备旧(HTC Desire HD),太多数据挤了它?这是正常行为吗?或者问题出在我的代码上,下面是一部分清单:
<activity android:name=".SplashView"
android:noHistory="true"
android:screenOrientation="portrait"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:configChanges="orientation" >
<intent-filter >
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
启动画面:
public class SplashView extends SherlockActivity {
private final int SPLASH_DISPLAY_LENGHT = 1000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().hide();
setContentView(R.layout.splash_view);
try {
RefreshRatingsTask urt = new RefreshRatingsTask();
urt.execute();
} catch (Exception e) {
// ignore
}
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent mainIntent = new Intent(SplashView.this,
MainActivity.class);
SplashView.this.startActivity(mainIntent);
SplashView.this.finish();
}
}, SPLASH_DISPLAY_LENGHT);
}
}
谢谢