gpt4 book ai didi

Android 相当于 iPhone 的默认图像

转载 作者:行者123 更新时间:2023-11-29 14:07:03 25 4
gpt4 key购买 nike

是否可以在启动应用程序时设置默认图像?在 iPhone 上,我可以设置一个名为“Default.png”的图像来执行此操作。但是在 Android 上有可能吗?

(我问这个信息是因为我不能对其他人使用 splascreen View 或自动 Activity ,因为第一个 Activity 中有视频 View 。)

最佳答案

我不明白为什么不使用 splashscrean

public class SplashScreenActivity extends Activity {
protected boolean _active = true;
private Thread splashTread;
protected int _splashTime = 2000; // time to display the splash screen in ms

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash_screen);
// thread for displaying the SplashScreen
final SplashScreenActivity sPlashScreen = this;
// thread for displaying the SplashScreen
splashTread = new Thread() {
@Override
public void run() {
try {
synchronized (this) {
// wait 5 sec
wait(_splashTime);
}
} catch (InterruptedException e) {

} catch (UnsupportedOperationException e1) {
// TODO: handle exception
} finally {
finish();
// start a new activity
Intent i = new Intent();
i.setClass(sPlashScreen, Your videoViewActivity.class);
startActivity(i);
}
}
};
splashTread.start();
}

// Function that will handle the touch
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
synchronized (splashTread) {
splashTread.notifyAll();
}
}
return true;
}
}

关于Android 相当于 iPhone 的默认图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6253769/

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