public class SplashActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.shan); new Handler().postDelayed(new Runnable() { @Override public void run() { I
1.最近的项目中,有一个Activity用到Fragment+ViewPager,其中一个fragment中实现了视频播放的功能,包含有SurfaceView.结果,每次打开程序第一次进入到该Activity时都会闪屏黑一下.原因就出在SurfaceView. 详解: I think I found the reason for the black flash. In my case I’m using a SurfaceView inside a Fragment and dynamicall
结果: 1.在启动时马上出现图片界面,但在出现程序界面前会有黑屏,大约有0.2秒左右. 实现: 1.建立2个文件:loading.png和styles.xml: ①其中loading.png是启动时替代黑屏的图片. ②styles.xml是对背景图片的定义,其内容为: <resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from re