80,360
社区成员
发帖
与我相关
我的任务
分享
if(bp != null){
try {
long t1 = System.currentTimeMillis();
WallpaperManager.getInstance(ctx).setBitmap(bp);
long t2 = System.currentTimeMillis();
Log.i("aaaaa","execute time:"+(t2-t1)/1000.0+" seconds");
} catch (IOException e) {
e.printStackTrace();
}
}
if(bp != null){
try {
long t1 = System.currentTimeMillis();
G.getBaseInstance.setWallpaper(bp);
long t2 = System.currentTimeMillis();
Log.i("aaaaa","execute time:"+(t2-t1)/1000.0+" seconds");
} catch (IOException e) {
e.printStackTrace();
}
}
public void setStream(InputStream data) throws IOException {
try {
ParcelFileDescriptor fd = sGlobals.mService.setWallpaper(null);
if (fd == null) {
return;
}
FileOutputStream fos = null;
try {
fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
setWallpaper(data, fos);
} finally {
if (fos != null) {
fos.close();
}
}
} catch (RemoteException e) {
}
}