启动/加载时的图像
我正在开发一个应用程序,当它从 onCreate 点加载时,我只是有一个黑屏(直到应用程序站稳脚跟)。看看其他应用程序,他们有公司徽标或很酷的图像,会弹出几秒钟,有人可以告诉我该怎么做吗?
是否可以将其设置为最短显示时间?
I ma developing an app, which at the moment when it is loading from the onCreate point, I just have a black screen (until the app gets its footing). Looking at other apps they have a company logo or cool image that pops up for a few seconds, can someone tell me how to do this please?
And if you can set it to display for a minimal time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
创建一个新活动,将图像显示几秒钟并重定向到您的主要活动:
将您的图像设置为该活动的背景。希望有帮助。祝你好运!
Create a new activity that displays the image for a few seconds and redirects to your main activity:
Set your image as the background for this activity. Hope that helps. Good luck!
该启动图像也称为“启动画面”。 在这里您可以找到如何制作闪屏。
This start up image also known as 'splash screen'. Here you can find how to make splash screen.
您的需求是启动画面。这是我的启动画面代码。
只需添加新活动并设置打开该活动的应用程序即可。
public class SplashActivity extends DeviceInfoAbstractActivity {
这是我的 getClearCacheIntent() 方法
在这些之后,您的启动屏幕将在屏幕上停留 2 秒钟。做你想做的事 =)
Your needs is callign Splash Screen. Here is my splash screen code.
Just add new activity and set application for opening this activity.
public class SplashActivity extends DeviceInfoAbstractActivity {
and this my getClearCacheIntent() method
after these, your splash screen stays on screen for 2 seconds. Do whatever you want =)