Android应用程序 启动画面
16lz
2021-01-23
由一个Activity 跳转到另一个Activity ,延时。 public class ScreenSplash extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // View view = new SplashView(ScreenSplash.this); setContentView(R.layout.splash); // setContentView(view); /** set time to splash out **/ final int nWelcomeScreenDisplay = 5000; new Handler().postDelayed(new Runnable() { @Override public void run() { Intent mainIntent = new Intent(ScreenSplash.this, Main.class); startActivity(mainIntent); ScreenSplash.this.finish(); } }, nWelcomeScreenDisplay); } // class SplashView extends View { // SplashView(Context context) { // super(context); // } // protected void onDraw(Canvas canvas) { // super.onDraw(canvas); // Paint paint = new Paint(); // BitmapFactory.Options options = new BitmapFactory.Options(); // options.inSampleSize = 2;//图片宽高都为原来的二分之一,即图片为原来的四分之一 // Bitmap bitmap = BitmapFactory.decodeResource(getResources(), // R.drawable.bg_control_panel_land); // // canvas.drawBitmap(bitmap, 0, 0, paint); // } // } }
更多相关文章
- android如何拍照以及返回拍的图片(经过验证的实际例子)
- android从相册或者照相获取图片,并且进行裁切
- android下图片压缩 -- 图像处理
- android帧动画(图片切换)——语音播放小喇叭
- Android前端开发15:显示网络图片
- Android Retrofit 图片上传的最简单和明白的实现方式
- Android设置桌面背景图片的方法
- Android从服务器获取图片的实例方法