Skip to content

Commit

Permalink
Update Readme to reflect new feature
Browse files Browse the repository at this point in the history
  • Loading branch information
rubengees committed Jan 29, 2016
1 parent f50cd26 commit b6d525c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ The `ProxerConnection` class provides static methods to retrieve Java representa

#### The `execute()` method

The request will automatically happen on a worker thread, thus not blocking the UI. You will mostly use this. The result is delivered through the [EventBus library] (https://github.com/greenrobot/EventBus). Each type of a result has an event, either a normal `IEvent` or an `ErrorEvent`.
The request will automatically happen on a worker thread, thus not blocking the UI. You will mostly use this. The result is delivered through the [EventBus library] (https://github.com/greenrobot/EventBus). Each type of a result has an event, either a normal `IEvent` or an `ErrorEvent`. Note: All events are postet sticky to make it possible to cache them also in the gab between `onStop()` and `onStart()` in which your class is not registred. You are responsible for cleaning sticky events once you don't need them anymore
A simple query for the news might look like this:

```java
@Override
public void onStart() {
super.onStart();

EventBus.getDefault().register(this);
EventBus.getDefault().registerSticky(this);
}

@Override
Expand All @@ -53,6 +53,9 @@ public void loadNews(int page){
}

public void onEventMainThread(NewsEvent result) {
//Remove sticky event as it is not needed anymore
EventBus.getDefault().removeStickyEvent(result);

//Update UI
}
```
Expand Down
1 change: 0 additions & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dependencies {
compile 'de.greenrobot:eventbus:2.4.0'
}


task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
Expand Down

0 comments on commit b6d525c

Please sign in to comment.