Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Wrap logic in resumeData()

Signed-off-by: simonewebdesign <hello@simonewebdesign.it>
  • Loading branch information...
commit 8f735177fa1cb17518014b28c47cda30cac107fb 1 parent 9153f9d
@simonewebdesign authored
Showing with 13 additions and 8 deletions.
  1. +13 −8 src/it/simoli/todolist/MainActivity.java
View
21 src/it/simoli/todolist/MainActivity.java
@@ -129,14 +129,7 @@ protected void onResume() {
Log.v(TAG, "onResume called!");
// Restore data from internal storage
- try {
- JsonUtil.restoreDataFromJSON(JsonUtil.readJSON(FILENAME, context),
- todoRows);
- } catch (IOException e) {
-
- e.printStackTrace();
- }
- adapter.notifyDataSetChanged();
+ resumeData();
}
@Override
@@ -158,6 +151,18 @@ public void saveData() {
}
}
+ public void resumeData() {
+
+ try {
+ JsonUtil.restoreDataFromJSON(JsonUtil.readJSON(FILENAME, context),
+ todoRows);
+ } catch (IOException e) {
+
+ e.printStackTrace();
+ }
+ adapter.notifyDataSetChanged();
+ }
+
@Override
public void onDialogEditClick(DialogFragment dialog) {
Please sign in to comment.
Something went wrong with that request. Please try again.