Comments (6)
Hello,
When a view gets destroyed combineLatest
receives null
instead of view so it should not keep a reference to the view anymore.
Could you please give me the piece of code that reproduces the issue? I'll try to check it with LeakCanary as well.
from nucleus.
The downside of not using restartables is that when you device is low on memory (or your device is Samsung with shitty memory settings) you can lose your background tasks while your app is in the background.
In my opinion, if you're not going to use restartables then there is no reason to use MVP at all. :D
from nucleus.
Hi,
I've uploaded a project that reproduces the problem (it includes a memory dump for MAT showing two instances of MainActivity
and two of MainActivityFragment
in memory). I've also noticed this only happens when using DeliverFirst
, not for DeliverLatestCache
or DeliverReplay
, and the leak appears for both restartables and non-restartables.
About my question, I was referring to the downside of skipping the call to add()
for our Subscription
s. I understand the importance of restartables because of Android killing the process but later restoring the view and so on, even if I acknowledge that's something usually ignored in Android development. The thing is, I am working with a big codebase that I want to refactor into using this approach and my idea was to keep things as simple as possible at first, hence avoiding adding more code to keep request state for now.
Not sure why you mention that there's no reason for MVP in this case, in my opinion it's worth it even if it's only to make background tasks survive configuration changes. Of course that not depends on the MVP pattern itself but on the concrete implementation that takes care of that. That's why I like Nucleus, it's just simple and does the job. But yes, maybe if one is only interested in surviving config changes/process restarts for small projects, using MVP can be overkill. I'll have a look at your Satellite library, looks promising!
from nucleus.
Thanks for the project, I'll look into it soon!
About not using restartables. There are no means for View to detect if it is not getting it's data because a request is too long or because the request has been destroyed. This is why restartables matter - they eliminate the "request has been destroyed" reason. Yep, it is up to you to use them. It was the reason for me. :D
from nucleus.
from nucleus.
Check out 2.0.2.
Thanks for the great report! :)
from nucleus.
Related Issues (20)
- Best practice for normal case. (get support.) HOT 3
- Wondering about multiple Presenter endpoint calls (Question) HOT 2
- How to get onComplete using restartable methods? HOT 1
- How could i force restartableFirst.onError with mockito? HOT 1
- RxJava latest version not used. HOT 1
- Console error saving file HOT 1
- Activity method called every time HOT 2
- (Question) Don't keep activieties option HOT 1
- Confusion about restartables and the Activity lifecycle HOT 3
- Does Nucleus support native Fragments? HOT 2
- Throwing VerifyError in < API 21 HOT 1
- Question regarding getView() and reference the View in the presenter. HOT 11
- Nucleus with Dagger 2 HOT 3
- NucleusActionBarActivity with support library 26 HOT 13
- Help with injecting Presenter when using AndroidInjector HOT 3
- Calling setPresenter in OnCreate HOT 2
- clear the delivery cache
- Crashes when starting a new activity using kotlin
- upgrade a new version for androidx, please
- getView() deprecated
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 nucleus.