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)'而不是增量 –