Create or inflate views programmatically in a RecyclerView OnCreateViewHolder
问题 Basically I wanted to create a layout or inflate a layout programatically with a RecyclerView , but was unable to do so. As I know how to do with xml by inflating it, but out of curiosity I wanted to do it programatically. My adapter code is as follows: public class ACShare extends RecyclerView.Adapter<ACShare.VHShare>{ private List<Integer> listDrawalbe; public ACShare(Context context) { TypedArray drawables = context.getResources().obtainTypedArray(R.array.s_array_contact_us_share);