Skip to content
Browse files

Merge pull request #88 from roughike/patch-1

Added instructions for RecyclerAdapter cleanup & corrected method names
  • Loading branch information...
2 parents 263c065 + e19bafa commit de3c357295d825cf17f0f4ce3470b2144d0087f3 @puf puf committed
Showing with 14 additions and 1 deletion.
  1. +14 −1 README.md
View
15 README.md
@@ -352,7 +352,7 @@ correct `TextView` controls from the `view`. The code is a bit verbose, but hey.
### Clean up When the Activity is Destroyed
-Finally, we need to clean up after ourselves. When the activity is destroyed, we need to call `release()`
+Finally, we need to clean up after ourselves. When the activity is destroyed, we need to call `cleanup()`
on the `ListAdapter` so that it can stop listening for changes in the Firebase database.
```java
@@ -459,6 +459,19 @@ recycler.setAdapter(mAdapter);
Like before, we get a custom RecyclerView populated with data from Firebase by setting the properties to the correct fields.
+### Clean up When the Activity is Destroyed
+
+Just like in the `ListAdapter` example, we need to clean up after ourselves. Call `cleanup()`
+on the `RecyclerAdapter` so that it can stop listening for changes in the Firebase database.
+
+```java
+@Override
+protected void onDestroy() {
+ super.onDestroy();
+ mAdapter.cleanup();
+}
+```
+
## Contributing
### Installing locally

0 comments on commit de3c357

Please sign in to comment.
Something went wrong with that request. Please try again.