Skip to content

Can give me some Suggest ? #2

Description

@CMingTseng

Dear Sir 
Very Thx your demo project .
I refer to your project
Used on my SQLite Benchmark example
https://github.com/CMingTseng/SQLiteMapBox
But I have a problem now.
I don't know if I can give me some advice or correct it.
My data is passed to RecyclerView.Adapter via LiveData.
Will pass 2 times
The first time is a summary of information from SQLite
The second time is the details from SQLite
When receiving details
Will trigger the notifyItemChanged of RecyclerView.Adapter to make UI changes
But I don't know if it is triggered too much in a short time? Or is my writing error?
UI will not change in the first time
Unless I scroll up and down slightly
And I wrote 3 ways

  1. There is another List to store the data after the SQLite query. The details change will modify the information in List through the key.
  2. Similar to the above but changed to use { ?} instead of key
  3. Directly pass the results of the SQLite query to the RecyclerView.Adapter. The details of the changes are in the RecyclerView.Adapter. After the key comparison, find the changed index to change.
    Results in the above three ways
    Sometimes there will be notifyItemChanged when the index is correct, but the UI is not displayed correctly!!??
    Unless scrolling up and down again
    The above is my problem
    Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions