~anjan/lift

c1a17de98e13e3437f3c2c848ba2e571338f2e74 — Anjandev Momi 4 years ago 3c4b336
Disable finishing activity and timercancel onPause
1 files changed, 5 insertions(+), 2 deletions(-)

M app/src/main/java/ca/momi/lift/Workout.java
M app/src/main/java/ca/momi/lift/Workout.java => app/src/main/java/ca/momi/lift/Workout.java +5 -2
@@ 402,6 402,7 @@ public class Workout extends AppCompatActivity {
    }

    private void writeData(String routineName, String dateString, String programName, boolean onPause, View v) {
        // TODO: split into multiple functions
        String workoutSessionText = "* " + routineName + "\n"
                + "SCHEDULED: <" + dateString + ">\n";



@@ 415,12 416,14 @@ public class Workout extends AppCompatActivity {
                    LastWorkout.onPausetxt;
        }

        if (currentWorkTimer != null) {
        if (currentWorkTimer != null & !onPause) {
            currentWorkTimer.timer.cancel();
        }

        if (checkStoragePermissionAndWrite((Activity) v.getContext(),  dateString, workoutSessionText)){
            finish();
            if (!onPause) {
                finish();
            }
        } else {
            Log.d(TAG, "writeData: failed. Try again");
        }