Skip to content

Commit

Permalink
Wrap logic in resumeData()
Browse files Browse the repository at this point in the history
Signed-off-by: simonewebdesign <hello@simonewebdesign.it>
  • Loading branch information
simonewebdesign committed Mar 15, 2013
1 parent 9153f9d commit 8f73517
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/it/simoli/todolist/MainActivity.java
Expand Up @@ -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
Expand All @@ -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) {

Expand Down

0 comments on commit 8f73517

Please sign in to comment.