gpt4 book ai didi

android - 在加载 Android 应用程序时设置背景图片

转载 作者:行者123 更新时间:2023-11-29 15:31:47 25 4
gpt4 key购买 nike

如何在加载时为我的 Android 应用程序添加背景?现在它显示白页。

最佳答案

public class SplashScreen extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splashscreen);
Thread splashThread = new Thread() {
@Override
public void run() {
try {
int waited = 0;
while (waited < 1000) {
sleep(100);
waited += 100;
}
} catch (InterruptedException e) {
// do nothing
} finally {

Intent i = new Intent(SplashScreen.this,Party_tablayout.class);

startActivity(i);
finish();
}
}
};
splashThread.start();
}
}

希望这对你有帮助..:-)

关于android - 在加载 Android 应用程序时设置背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5839775/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com