Saturday, 28 September 2013

new BitmapDrawable() is deprecated - Eclipse: Unable to resolve this error using several arguments?

new BitmapDrawable() is deprecated - Eclipse: Unable to resolve this error
using several arguments?

Team, Instead of using the easy way out [@SuppressWarnings("deprecation")]
I want to learn the right way. I tried several ways of fixing this but no
luck. How do I resolve this? thanks in advance.
new BitmapDrawable(mContext.getResoursces(), null) < not working new
BitmapDrawable(mContext.getResoursces()) < not working



mContext = context;
protected Drawable mBackground = null;
mWindowManager = (WindowManager)
context.getSystemService(Context.WINDOW_SERVICE);



if (mBackground == null)
mWindow.setBackgroundDrawable(new *BitmapDrawable()*);
else
mWindow.setBackgroundDrawable(mBackground);



public void setBackgroundDrawable(Drawable background) {
mBackground = background;
}

No comments:

Post a Comment