I have a recyclerview and sql lite database. I keep city names in SQLite database and display them in recyclerview. When the city is setOnclickListener in the recyclerview, the city’s weather is shown and I do this by taking the city’s id from the sql lite database. arrayList.get(position).id it worked in setOnClickListener but it doesnt work setOnLongClickListener I want to