Android应用程序发布时几秒钟的空白屏幕(无半透明主题可用) 我想摆脱应用程序启动几秒钟后显示的空白屏幕,但到目前为止我只找到了“半透明的主题解决方案”。但我无法将此解决方案应用于我的应用程序,因为启动程序活动是一个日志活动,通过“断开”按钮,我希望能够返回到它,而不使用半透明主题。 有什么办法吗? 非常感谢 试试这个 public class SplashScreen extends Activity { // Splash screen timer private static int SPLASH_TIME_OUT = 3000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); getSupportActionBar().hide(); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); new Handler().postDelayed(new Runnable() { /* * Showing splash screen with a timer. This will be useful when you * want to show case your app logo / company */ @Override public void run() { // This method will be executed once the timer is over // Start your app main activity Intent i = new Intent(SplashScreen.this, MainActivity.class); startActivity(i); // close this activity finish(); } }, SPLASH_TIME_OUT); } }

Android应用程序发布时几秒钟的空白屏幕(无半透明主题可用) 我想摆脱应用程序启动几秒钟后显示的空白屏幕,但到目前为止我只找到了“半透明的主题解决方案”。但我无法将此解决方案应用于我的应用程序,因为启动程序活动是一个日志活动,通过“断开”按钮,我希望能够返回到它,而不使用半透明主题。 有什么办法吗? 非常感谢 试试这个 public class SplashScreen extends Activity { // Splash screen timer private static int SPLASH_TIME_OUT = 3000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); getSupportActionBar().hide(); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); new Handler().postDelayed(new Runnable() { /* * Showing splash screen with a timer. This will be useful when you * want to show case your app logo / company */ @Override public void run() { // This method will be executed once the timer is over // Start your app main activity Intent i = new Intent(SplashScreen.this, MainActivity.class); startActivity(i); // close this activity finish(); } }, SPLASH_TIME_OUT); } },android,launch,Android,Launch,有关更多信息,请参见这称为启动屏幕或启动活动。您可以创建自己的飞溅。YouTube上有一些关于这方面的教程。我猜,你忘了在闪屏的布局文件中添加UI部分。你需要快速“加载”一些东西,比如占位符图像或从设备加载的简单网络视图。然后,在后台加载较慢的应用程序内容。加载后,请替换占位符图形/webview。这正是我需要的!谢谢:3

有关更多信息,请参见

这称为启动屏幕或启动活动。您可以创建自己的飞溅。YouTube上有一些关于这方面的教程。我猜,你忘了在闪屏的布局文件中添加UI部分。你需要快速“加载”一些东西,比如占位符图像或从设备加载的简单网络视图。然后,在后台加载较慢的应用程序内容。加载后,请替换占位符图形/webview。这正是我需要的!谢谢:3