0
这是我为我的启动画面代码:Android应用程序将不会打开
public class SplashScreenPear extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pear);
startAnimating();}
private void startAnimating(){
ImageView pearfade = (ImageView) findViewById(R.id.pearish);
Animation pearfadeact = AnimationUtils.loadAnimation(this, R.anim.fadein);
pearfade.startAnimation(pearfadeact);}
@Override
protected void onPause() {
super.onPause();
ImageView pearfade = (ImageView) findViewById(R.id.pearish);
pearfade.clearAnimation();
Animation pearfadeact = AnimationUtils.loadAnimation(this, R.anim.fadein);
pearfadeact.setAnimationListener(new AnimationListener() {
public void onAnimationEnd(Animation animation) {
// The animation has ended, transition to the Main Menu screen
startActivity(new Intent(SplashScreenPear.this, Unicorn.class));
SplashScreenPear.this.finish();
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationStart(Animation animation) {
}
});
}
@Override
protected void onResume() {
super.onResume();
startAnimating();
}
不幸的是,应用程序将不会打开,也不会从闪屏进步。我不相信我使用的模拟器存在问题,所以它必须是这些代码中的某些内容妨碍它完全运行。有什么我失踪?
这个问题很通用的,目前还不清楚代码是不会编译的,是抛出一个错误还是不像您期望的那样行事。告诉我们您的预期结果,以及您的实际结果与可能相关的任何logcat输出一起。 – 2011-01-24 23:28:31
发布您的logcat日志,确切例外。 – 2011-01-25 00:39:13