如何从SD卡上的图像设置主屏幕壁纸?
即:
try { wallpaperManager.setResource("/sdcard/wallpaper/olive.jpg"); finish(); } catch(IOException e) { e.printStackTrace(); }
没有工作,返回一个错误:'WallpaperManager类型中的方法setResource(int)不适用于参数(String)'
Bitmap o = BitmapFactory.decodeFile("/sdcard/wallpapers/olive.jpg"); try { wallpaperManager.setBitmap(o); finish(); } catch (IOException e) { e.printStackTrace(); }
1 回答