android-recyclerview

Deleting Card from RecyclerView and re-add it again

∥☆過路亽.° 提交于 2021-01-29 05:34:21
问题 I'm struggling to implement the funtionality to delete an entry of a recyclerview and re-add it again, if the user decided otherwise. For that I'm showing a Snackbar with an undo action. So the flow should be: The user sees a list of Cards which each show some values and an delete button. If the user presses the delete button, the card is deleted and a Snackbar is shown. If the user clicks undo on the Snackbar the Card should be re-added to the RecyclerView . Only if the Snackbar disappears

How to cache multiple URLs for a WebView Activity from Recycler View onClick

不问归期 提交于 2021-01-29 05:31:18
问题 I have setup a WebViewActivity which gets the URL from the intent. I have setup an onClickListener for my Recyclerview which opens the WebViewActivity and loads the URL. However the WebView does not cache each an every page it opens. What changes should i make in the code? WebViewActivity.java public class WebViewActivity extends AppCompatActivity { WebView myWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

Nested Recyclerview Issues

会有一股神秘感。 提交于 2021-01-29 05:28:59
问题 I have a fragment with parent RecyclerView and his child (the child is inner recyclerview). When I scroll to bottom (last data), and scroll it again to top, I found the problem. One of data is missing. When I try to scroll to bottom again and scroll to top, the data is random. Anyone can help me? HomeFragment GridLayoutManager gl = new GridLayoutManager(getContext(), 1, GridLayoutManager.VERTICAL, false); ParentAdapter adapter = new ParentAdapter(getContext(), parentList); rcvParent

notifydatasetchanged not working from async task

帅比萌擦擦* 提交于 2021-01-29 05:16:17
问题 hi i think my issue is related to this notifyDataSetChanged not working on RecyclerView im trying to refresh my layout from an async task but when im calling notify datasetchanged nothing happens, but if i create a new instance of the adapter and call notifydatasetchanged then it does work ive tried a few things to no avail and wonder what im doing wrong, i reference it like this public ListAdapter cardAdapter; then in onCreate i initialise everything to do with my recycler view, (the only

Why is the drag animation being repeated in RecyclerView?

可紊 提交于 2021-01-29 05:16:03
问题 The bounty expires in 6 days . Answers to this question are eligible for a +50 reputation bounty. gig6 wants to draw more attention to this question. I am using the ItemTouchHelper class to support drag and drop in my RecyclerView. While I am dragging an item around it visually updates (swaps rows) as expected. Once I drop the item, another **visual** drag occurs. For example (see diagram below) if I drag item "a" from index 0 to index 3, the correct list shows that item "b" is now at index 0

Android Picasso image loading app crash when scrolling RecyclerView

对着背影说爱祢 提交于 2021-01-29 02:44:41
问题 I am using Retrofit to access this Webservice link: https://jsonplaceholder.typicode.com/photos When loading the items in a recyclerview without loading images, the app works fine. However, if I add Picasso code to load the images, the app crashes after scrolling 2 or three times. I get the following error: A/Looper: Could not make wake event fd: Too many open files OR these errors all together: E/Parcel: fcntl(F_DUPFD_CLOEXEC) failed in Parcel::read, i is 0, fds[i] is -1, fd_count is 1,

i have recyclerview with searchview how to send details data about item i searched about

蹲街弑〆低调 提交于 2021-01-29 02:24:17
问题 I have recyclerview with searchview and have details data sended when select item in recyclerview problem is when i search about item and select it the details data not change always appears the first item's details data how can i send details data about the items that i searched about i think it not big issue so pls help me this my code: in my Main avtivity private void initRecyclerView(){ RecyclerView recyclerView = findViewById(R.id.recyclerView); // adapter = new RecyclerViewAdapter

i have recyclerview with searchview how to send details data about item i searched about

怎甘沉沦 提交于 2021-01-29 02:22:39
问题 I have recyclerview with searchview and have details data sended when select item in recyclerview problem is when i search about item and select it the details data not change always appears the first item's details data how can i send details data about the items that i searched about i think it not big issue so pls help me this my code: in my Main avtivity private void initRecyclerView(){ RecyclerView recyclerView = findViewById(R.id.recyclerView); // adapter = new RecyclerViewAdapter

How to add onClickListener to the items of the recyclerView in Kotlin?

ぃ、小莉子 提交于 2021-01-29 02:01:04
问题 I am using recyclerView to show data from firebase database and I want to handle clicks, Now the important part is that I want to know the number that was clicked in order to test google play in app billing before showing the next activity I mean user should click item number one then pay to see information number 1 and so on Any help, please ? //my adapter class MyAdapter( private val arrayList: ArrayList<Long> ) : RecyclerView.Adapter<MyAdapter.MyViewHolder>() { override fun

How to display total checkbox checked in a recyclerview

醉酒当歌 提交于 2021-01-28 21:52:01
问题 I am trying to create a simple pokedex where you can keep track of how many pokemons you have collected. The trouble I am having is the checkbox in a recyclerview. I want to have the total which is currently at zero, go up for each checkbox checked. If unchecked the number will go down. The total number is simply just shown in a text view. Below is an image showing what I am trying to explain, in case I am not explaining it as clearly. Here is my code Adapter Class class MainAdapter(val