Comments (8)
I add a headview for RecyclerView and use notifyItemRangeChanged(0, mDatas.size()) in adapter,this problem appeared. finally, I fixed it by change notifyItemRangeChanged(0, mDatas.size()) to notifyItemRangeChanged(1, mDatas.size()), it worked fine.
from recyclerview-animators.
Smooth scrolling before animation finishes randomly causes this crash.
from recyclerview-animators.
@ypresto Hello, I can see that your fix is included in library version 2.2.6, but I'm using version 2.2.7 of the library and can still see this issue happening.
I'm not using any headers or footers, just a homogeneous list.
When replacing data, I always clear all the items like this in my adapter:
data.clear();
data.addAll(newData);
Where data is a List of items.
I do use smoothScrollToPosition
after updating the items.
I also use DiffUtil to calculate changes in my adapter and usually, everything works fine, but in very rare cases it crashes with java.lang.IllegalArgumentException: Called attach on a child which is not detached
. I have no how to reproduce it, I only see a few % of users getting this on my crash reporting tool.
from recyclerview-animators.
I also use header with Recyclerview. when i app item at 1 position because at 0 position header is present but when i add item at 1 position .i get new data added at 2 position instead of 1 position in recyclerview. so i try to add item at 0 position and notifyItemRangeChanged to start from 1. still my app crash.
if (!userInfoList.contains(peopleDetailInfo)) {
userInfoList.add(0,peopleDetailInfo);
notifyItemInserted(0);
notifyItemRangeChanged(1,userInfoList.size());
}
from recyclerview-animators.
Hi @wasabeef , Can you show the code? If your code is on gitHub and open, share repo link.
from recyclerview-animators.
Hi,
Sorry I can't, I put together a sample app to show the crash, but it does happen so I guess something else is going on in our code.
from recyclerview-animators.
Related, with a repro case. Can't promise it's the same issue, but the symptom is the same.
https://code.google.com/p/android/issues/detail?id=172416
from recyclerview-animators.
@xiong-it thanks
from recyclerview-animators.
Related Issues (20)
- not working in my project HOT 2
- The FlipAnimator on Android-P may cause crashes.
- Blinking after changing item heigth
- Is there a way to animate in this way (video inside)?
- java
- Bug: App does not compile
- FlipInTopXAnimator crashes in Android Pie
- Deleting multiple (50+) items from recycler view is throwing exception (Stacktrace attached) HOT 1
- MultipleBuildFailures error: failed linking references.
- Animation not displaying with data already initialized. HOT 1
- Option to disable the start delay HOT 1
- Help converting to Java HOT 1
- Animation dose not worked HOT 1
- animation not worked properly when i put recyclerview inside nested scrollview HOT 1
- Remove Animation Is Applied To All Items Strange Behaviour HOT 1
- Default ItemAnimators don't use interpolator from constructor
- Add animations work; Remove animations are clunky HOT 2
- Java Settings The following code does not run
- Animator Crashing
- Smooth scroll to first Item befor start animation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recyclerview-animators.