0
我有一个短暂的延迟启动画面,延迟后,它移动到splashscreen但我似乎无法覆盖过渡,我不明白为什么......虽然过渡确实工作在调试模式很奇怪Android转换不起作用
package com.example.android.bubblestrouble;
import android.app.Activity; import android.content.Intent; import android.os.Bundle;
公共类队延伸活动{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
final int delay = 3000;
setContentView(R.layout.team);
Thread welcomeThread = new Thread()
{
int wait = 0;
@Override
public void run()
{
try {
super.run();
/**
* use while to get the splash time. Use sleep() to increase
* the wait variable for every 100L.
*/
while (wait < delay)
{
sleep(100);
wait += 100;
}
}
catch (Exception e)
{
System.out.println("EXc=" + e);
}
finally
{
/**
* Called after splash times up. Do some action after splash
* times up. Here we moved to another main activity class
*/
startActivity(new Intent(Team.this, SplashScreen.class));
Team.this.finish();
Team.this.overridePendingTransition(R.anim.fade, R.anim.hold);
}
}
};
welcomeThread.start();
}
}
感谢,虽然这个应用程序,心不是最好的做法。主要问题是,我不明白为什么overridePendingTransition不起作用。我正尝试使用转换效果,这是实现这个的最佳方法 – Chris
也许问题出在睡眠周期?尝试使用'睡眠(3000)'而不是增量 –