从对SD卡的图像设置壁纸图像、壁纸、SD

由网友(该用户身份不明)分享简介:一个人怎么会去从图像设置主屏幕壁纸上的SD卡? 即:尝试{wallpaperManager.setResource(/ SD卡/壁纸/ olive.jpg);完();}赶上(IOException异常E){e.printStackTrace();}没有工作,返回了一个错误:该方法setResource(INT)在类...

一个人怎么会去从图像设置主屏幕壁纸上的SD卡?

即:

 尝试{
    wallpaperManager.setResource(/ SD卡/壁纸/ olive.jpg);
    完();
}赶上(IOException异常E){
    e.printStackTrace();
}
 

没有工作,返回了一个错误:该方法setResource(INT)在类型WallpaperManager不适用的参数(字符串)

解决方案

 位图O = BitmapFactory.de codeFILE(/ SD卡/壁纸/ olive.jpg);

尝试 {
  wallpaperManager.setBitmap(O);
  完();
}
赶上(IOException异常E){
  e.printStackTrace();
}
 

单反相机SD卡RAW照片在手机上有显示能导入,但在笔记本电脑上不显示是什么缘故 怎样导入RAW照片

How would one go about setting the homescreen wallpaper from an image on the SDcard?

i.e.:

try {
    wallpaperManager.setResource("/sdcard/wallpaper/olive.jpg");
    finish();
} catch(IOException e) {
    e.printStackTrace();
} 

hasn't worked, returned an error: 'The method setResource(int) in the type WallpaperManager is not applicable for the arguments (String)'

解决方案

Bitmap o = BitmapFactory.decodeFile("/sdcard/wallpapers/olive.jpg");

try {
  wallpaperManager.setBitmap(o);
  finish();
} 
catch (IOException e) {
  e.printStackTrace();
}

阅读全文

相关推荐

最新文章