Clear sliderViews from SliderLayout didn't clear previous images
See original GitHub issueI want to clear slider before add another slider, but the previous image didn’t clear.
private fun setSliderViews(bannerArr: JsonArray) {
if (imageSlider != null) {
imageSlider.clearSliderViews()
}
val sliderView = DefaultSliderView(requireContext())
for (i in 0 until bannerArr.size()) {
val bannerObj = bannerArr[i].asJsonObject
sliderView.imageUrl = bannerObj.get("image_url").asString
if (imageSlider != null) {
imageSlider.addSliderView(sliderView)
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
AndroidImageSlider library memory leak - Stack Overflow
I use it in my project and it perfectly fulfills all the needs. The only trouble is memory leak which occurs after fragment...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can check this library https://github.com/OpenSooq/Pluto it has the ability to have full control over your views and layout and not depending on any image library
Update to 1.3.0 , and use SliderAdapter , you can clear adapter and call notifyDataSetChanged(); it should clear sliderLayout like a charm.