반응형
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();
반응형
'안드로이드' 카테고리의 다른 글
RecyclerView #2 - 구분선 추가, 아이템간 간격 조절 (0) | 2019.03.18 |
---|---|
RecyclerView #1- 구조 및 기본 사용법 (0) | 2019.03.13 |
Navigation Drawer 의 Layout구조 (2) | 2019.02.27 |
Android resource compilation failed (3) | 2019.02.23 |
Activity간 Object 공유- Parcelable (0) | 2019.02.21 |