question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Q/A (was: Some doubts)

See original GitHub issue

Hi!

I’m working on an app I want to use Nucleus for MVP+Rx.

I have some doubts, and I couldn’t find any solution in the documentation/wiki. Could you please help me?:

  1. How can I use two instances of the same view, and make each of them have their own instances of their presenters? Is it possible by telling the PresenterStorage with ID to use? Or by any other way?

  2. Why is the presenter being destroyed and pointed to null in the onPause method instead of doing so in onDestroy? The documentation seems to be out of date. What if I want to stack several activities of the same type, and want them to keep their presenters while not destroyed by the system? Is that working because you pass isFinishing() to the delegate?

  3. I think we need more documentation about the restartable* methods in RxPresenter. I know that it is documented in the code with Javadoc, but I think it would be great to add some explanation in the wiki. Something like the deliver* methods documentation (btw, some of them seem to be out of date since you released version 2.0.1).

Thank you very much. Your library is great. Cheers, M.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:64 (33 by maintainers)

github_iconTop GitHub Comments

1reaction
konmikcommented, Jun 10, 2016

I would use a separate presenter for each fragment. One view - one presenter.

If you do not need a presenter for the activity itself, you don’t need to extend NucleusAppCompatActivity. All view classes can work independently. I advise you to look inside them, they are very simple and must be very easy to read.

1reaction
PaulWoitaschekcommented, Apr 30, 2016

@inorichi I’m always using the factory methods to eliminate reflection and use the constructor to set the factory.

So I have

/**
 * Base class that forces setting a presenter factory so reflection will be eliminated.
 *
 * @author Paul Woitaschek
 */
public abstract class NucleusBaseActivity<V, P extends Presenter<V>> extends NucleusAppCompatActivity<P> {

   public NucleusBaseActivity() {
      setPresenterFactory(newFactory());
   }

   @NonNull protected abstract PresenterFactory<P> newFactory();
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 50 QA (Quality Assurance) Interview Questions ... - Indeed
Here are 50 top quality assurance interview questions and sample answers to help prepare you for your next interview for a software quality...
Read more >
40 QA (Quality Assurance) Interview Questions and Answers
40 QA (Quality Assurance) Interview Questions and Answers · 2) What is Testware? · 3) What is the difference between build and release?...
Read more >
20 Selective QA Interview Questions To Clear Interview In 2022
20 Best and the most frequently asked Quality Assurance QA interview questions and answers for preparing Quality assurance interview.
Read more >
27 Common QA Interview Questions (And Answers!)
List Of QA Interview Questions and Answers · 1. Why should I hire you? · 2. What is a bug? · 3. What...
Read more >
Top 75 QA Interview Questions & Answers With Examples
Are you looking to move into the world of automated software testing as a QA engineer? Here's a list of top questions and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found