解决三星手机启始页background不显示

只有三星手机会出现这个问题,其他手机不会出现

解决如下(加入红字部分代码):
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// this.overridePendingTransition(R.anim.activity_open_enter, R.anim.activity_open_exit);
setContentView(R.layout.baidu_splash_activity);
FrameLayout layout = (FrameLayout)findViewById(R.id.main);
InputStream is ;
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inPreferredConfig = Bitmap.Config.ARGB_8888;
opt.inPurgeable = true;
opt.inInputShareable = true;
opt.inSampleSize = 2;
is= getResources().openRawResource(R.drawable.splash3);
Bitmap bm = BitmapFactory.decodeStream(is, null, opt);
BitmapDrawable bd = new BitmapDrawable(getResources(), bm);
layout.setBackgroundDrawable(bd);
initData();
loadData();
setData();
Handler handler = new Handler();
/**
* 需要延时才可以看到,否则太快看不到
* */
handler.postDelayed(switchRunnable,500);

}

你可能感兴趣的:(解决三星手机启始页background不显示)