반응형

getInflater


LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

LayoutInflater inflater = LayoutInflater.from(context);




Color

ContextCompat.getColor(getContext(),R.color.list_bg_normal));

public void setBackgroundColor( @ColorInt int color) {

vContainer.setBackgroundColor(color);

}


isetBackgroundResource( R.color.list_bg_normal);

public void setBackgroundResource( @DrawableRes int resid) {

vContainer.setBackgroundResource(resid);

}


String

String categoryName = Any.getContext().getResources().getString(R.string.default_category_name);



ImageView to Bitmap

Bitmap bitmap = ((BitmapDrawable) mivSumnail.getDrawable()).getBitmap();

반응형

+ Recent posts