如何設置圖像壁紙全圖像背景屏幕。我的代碼Android-設置壁紙我的完整圖像
Bitmap bmap = BitmapFactory.decodeResource(getResources(),
R.drawable.splash);
DisplayMetrics outMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(outMetrics);
int w = outMetrics.widthPixels;
int h = outMetrics.heightPixels;
Bitmap wallpaper=Bitmap.createScaledBitmap(bmap, w, h, true);
WallpaperManager m = WallpaperManager.getInstance(getApplicationContext());
try {
m.setBitmap(wallpaper);
} catch (IOException e) {
e.printStackTrace();
}
我需要像全套牆紙
是從我的回答任何幫助。 –