You DO need to add your own constructor. The message is pretty explicit -- you are making an invalid call when you do
adapter = new package_adapter (className.this, itemList);
RecyclerView.Adapter does
not have a constructor that takes parameters.
Based on the rest of the class, your constructor should be something like
public package_adapter (Context ctx, List<item> items)
{
itemList = items;
context = ctx;
}
You say you "tried adding the constructor but it didn't return me the result" -- what does that mean? What error or unexpected behavior are you getting? I'm guessing it's probably an error in either your parsing to get the values used to construct an
item, or something in the
item class itself (no code shown). Use your debugger and see what each
item looks like. What you'e shown of the adapter class looks okay.