[Android][Question] Tutorial 2 memory leak inner class question
Open
Nobody has claimed this yet.
Android
- Dominant language
- Kotlin
- Stars
- 7.9k
- Forks
- 914
- PR merge metrics
- No merged PRs in 30d
Description
I'm at the beginning of tutorial 2, seeing a strange non-static inner class:
@RibInteractor
public class RootInteractor extends Interactor<RootInteractor.RootPresenter, RootRouter> {
//...
class LoggedOutListener implements LoggedOutInteractor.Listener {
@Override
public void login(String userName) {
// Switch to logged in. Let’s just ignore userName for now.
getRouter().detachLoggedOut();
getRouter().attachLoggedIn();
}
}
}
Also, the login listener is referenced by a very strange syntax in RootBuilder: rootInteractor.new LoggedOutListener()
What is that?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tutorial 2's RootInteractor and RootBuilder references shown in the issue. Review the non-static LoggedOutListener declaration and the rootInteractor.new LoggedOutListener() usage, including the reported memory-leak concern. Done means providing a clear explanation of both constructs and their lifecycle implications.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- documentation, mobile-dev
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100