android 从asserts 读取图片做背景

            InputStream is = getAssets().open("odin/game_splash.png");

            Options opts = new Options();
            opts.inPreferredConfig = Config.RGB_565;
            Bitmap bitmap = BitmapFactory.decodeStream(is, null, opts);
            frameLayout.setBackgroundDrawable(new BitmapDrawable(bitmap));

你可能感兴趣的:(android 从asserts 读取图片做背景)