I was trying to inflate a layout and i came across these two code.Can someone please tell me the difference between these two inflate method? I am new to android studio and i want to learn more about this inflate method. Also apart from these two are there any other way to inflate a layout?
public MyViewHolder onCreateViewHolder(ViewGroup parent,int viewType){
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.movie_list_row, parent, false);
return new MyViewHolder(itemView);
}
and
LayoutInflater inflater = LayoutInflater.from(context);
View rowView = inflater.inflate(R.layout.list_single, null, true);
return rowView;
}