• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

problem in skipping layout adapater

package com.example.mansoormushtaq.fypproject

import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.squareup.picasso.Picasso
import kotlinx.android.synthetic.main.recylce_post.view.*

class PostsAdapter(var context: home_frgmnt, var newProductList:ArrayList<item>) : RecyclerView.Adapter<PostsAdapter.ViewHolder>() {



override fun onCreateViewHolder(p0: ViewGroup, p1: Int): ViewHolder {
var view:View = LayoutInflater.from(p0.getContext()).inflate(R.layout.recylce_post,p0 ,false)
return ViewHolder(view)


}

override fun getItemCount():Int{
return newProductList.size
}

override fun onBindViewHolder(p0: PostsAdapter.ViewHolder, p1: Int) {
(p0 as ViewHolder).bind(newProductList[p1].catname,newProductList[p1].catimage)

}

class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
fun bind(n:String,p:String){
itemView.recylertext.text=n
Picasso.with(itemView.context).load("http://localhost/categoryimage"+p).into(itemView.reclyerimage)


}




}
}
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones