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.

Method not call =(

ActivityA MyViewA PresenterA

ActivityB MyViewB PresenterB

  1. In ActivityA user click btn “Create new task”
  2. Open ActivityB, user do something and click btn “Save”
  3. PresenterB send event to PresenterA - new task was created
  4. PresenterA receive event and call getViewState().newTaskWasCreate()

Method not call =( because if (mViews == null || mViews.isEmpty()) { return; } mViews.isEmpty() - true

But if I use handler with delay it is work fine

MyViewA @StateStrategyType(SkipStrategy.class) void newTaskWasCreate(long taskId, long projectId, int fragmentPosition);

PreventerA @Subscribe(sticky = true) public void onEvent(MyTasksEvent.NewTaskWasCreate event){ getViewState().newTaskWasCreate(event.getTaskId(), event.getProjectId(), event.getFragmentPosition()); }

Generate ` @Override public void newTaskWasCreate(long taskId, long projectId, int fragmentPosition) { NewTaskWasCreateCommand newTaskWasCreateCommand = new NewTaskWasCreateCommand(taskId, projectId, fragmentPosition); mViewCommands.beforeApply(newTaskWasCreateCommand);

	if (mViews == null || mViews.isEmpty()) {
		return;
	}

	for(MyTaskFragmentView view : mViews) {
		getCurrentState(view).add(newTaskWasCreateCommand);
		view.newTaskWasCreate(taskId, projectId, fragmentPosition);
	}

	mViewCommands.afterApply(newTaskWasCreateCommand);
}

`

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
CherryPerrycommented, Jan 8, 2017

I wanna show snake bar and use AddToEndStrategy, when rotate screen, snake bar show again.

OneExecutionStateStrategy.class

0reactions
PavelDolbikcommented, Jan 8, 2017

Thanks for your answer! I do not know about this strategy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IsEmpty Function - Microsoft Support
Returns a Boolean value indicating whether a variable has been initialized. Syntax. IsEmpty ( expression ). The required expressionargument is a Variant ...
Read more >
7 Refreshing Materialized Views - Oracle Help Center
This chapter discusses how to refresh materialized views, which is a key element in maintaining good performance and consistent data when working with ......
Read more >
Creating and refreshing materialized views in PostgreSQL
A “materialized view” is a database object which stores the result of a precalculated database query and makes it easy to refresh this ......
Read more >
How to show a message when collection view is empty
... (self.movies.count == 0) { self.collectionView.setEmptyMessage("Nothing to show :(") } else { self.collectionView.restore() } return self.movies.count }.
Read more >
How to check if a model is empty or not? : r/django - Reddit
exists() will stop querying at the first object, while MyModel.objects.count() will go through all the table. So exists is a far better approach....
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