Android WallpaperManager解析及BUG解决(二)

2014-11-24 01:45:45 · 作者: · 浏览: 7
, "failed parsing " + file + " " + e);
}
try {
if (stream != null) {
stream.close();
}
} catch (IOException e) {
// Ignore
}


if (!success) {
mWidth = -1;
mHeight = -1;
mName = "";

}


// We always want to have some reasonable width hint.
WindowManager wm = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
Display d = wm.getDefaultDisplay();
int baseSize = d.getMaximumSizeDimension();
if (mWidth < baseSize) {
mWidth = baseSize;
}
if (mHeight < baseSize) {
mHeight = baseSize;
}
}