Skip to content

Commit a674147

Browse files
committed
App crash on Zero time in Comprehension solved
1 parent 0e252f6 commit a674147

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

source-code/app/src/main/java/org/buildmlearn/toolkit/templates/ComprehensionTemplate.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ private static boolean validated( Context context, EditText title, EditText pass
6767
}else if (timerText.length() > 9) {
6868
timer.setError(context.getString(R.string.comprehension_template_timer_correct_hint));
6969
return false;
70+
}else if ("0".equals(timerText)) {
71+
timer.setError((context.getString(R.string.time_zero_error)));
72+
return false;
7073
} else if ("".equals(timerText)) {
7174
timer.setError(context.getString(R.string.comprehension_template_timer_hint));
7275
return false;

source-code/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,5 +406,6 @@
406406
<string name="title_valid">Title must start with alphanumeric</string>
407407
<string name="valid_msg_name">Enter valid name</string>
408408
<string name="same_options">Two or more options are same.</string>
409+
<string name="time_zero_error">Time can\'t be zero</string>
409410
</resources>
410411

0 commit comments

Comments
 (0)