bkg is always null because you assign the drawable to a method field bkg not to the class field bkg:
Change your method to this
public static void setPageBackground(Context context, View view) {
if (null == bkg) {
//Drawable bkg = getResources().getDrawable(R.drawable.bg2);
//use class field bkg
bkg = context.getResources().getDrawable(R.drawable.bg2);
bkg.setAlpha(50);
}
view.setBackgroundDrawable(bkg);
}