title: NumberFormatException occurs on previous String key when Database changes
body: <p>Every time the value in database changes causes the related activity stops working. But after starting the activity again the display and data retrieved will still work and is updated.</p>
  
  <p>I found this in Logcat:</p>
  
  <pre><code>AndroidRuntime: FATAL EXCEPTION: main
  java.lang.NumberFormatException: For input string: "201908241000gjjj"
  </code></pre>
  
  <p>That is a string key for database:</p>
  
  <pre><code>//formatDateTime and parseDateTime are methods to simplify simpleDateFormat and return String
  String stringDate = formatDateTime(dateFromString, "yyyyMMdd");
  String stringTime = parseDateTime(taskTime, "hh:mm a", "HHmm");
  final String key = stringDate + stringTime + taskParticipant;
  dbrSchedule.child(key).setValue(schedule); //schedule is model class
  </code></pre>
  
  <p>I never ask the code to retrieve and parse it to Numeric. Inside onCreate:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      dbrCurrentTask.orderByChild("dateOrder").startAt(stringDateForWorkingInProgress).endAt(stringDateForCurrent).addValueEventListener(todayTasks);
  }
  
  private ValueEventListener todayTasks = new ValueEventListener() {
      @Override
      public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
          scheduleList.clear();
          for (DataSnapshot scheduleTaskDS : dataSnapshot.getChildren()) {
              final ScheduleFD scheduleTemp = scheduleTaskDS.getValue(ScheduleFD.class);
              if (scheduleTemp != null) {
                  if ((scheduleTemp.getDateOrder().equals(stringDateForCurrent) &amp;&amp; !scheduleTemp.getStatus().equals(getString(R.string.task_completed))) || (!scheduleTemp.getDateOrder().equals(stringDateForCurrent) &amp;&amp; scheduleTemp.getStatus().equals(getString(R.string.working_in_progress)))) {
                      scheduleList.add(scheduleTemp);
                  }
              }
          }
          tra = new TaskFDAdapter(ScheduleCheckInOut.this, scheduleList);
          trv.setAdapter(tra);
  
          if (!scheduleList.isEmpty()) {
              handler.postDelayed(runnable, 360);
          }
      }
  
      @Override
      public void onCancelled(@NonNull DatabaseError databaseError) {
  
      }
  };
  
  @Override
  protected void onDestroy() {
      super.onDestroy();
      dbrCurrentTask.orderByChild("dateOrder").startAt(stringDateForWorkingInProgress).endAt(stringDateForCurrent).removeEventListener(todayTasks);
  }
  </code></pre>
  
  <p>Also I have did same thing but with try catch:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      try {
          dbrCurrentTask.orderByChild("dateOrder").startAt(stringDateForWorkingInProgress).endAt(stringDateForCurrent).addValueEventListener(todayTasks);
      } catch (NumberFormatException e){
          //refresh
          finish();
          overridePendingTransition(0, 0);
          startActivity(new Intent(getApplicationContext(), THIS_ACTIVITY.class));
          overridePendingTransition(0, 0);
  }
  </code></pre>
  
  <p>But it still show NumberFormatException in Logcat and stop working when database value is changed.<br>
  I also tried to change my string key to without any numeric but same Exception shown.</p>
  
  <p>After a lot of testing, I found that the string key <code>201908241000gjjj</code> which shown in Error: <code>java.lang.NumberFormatException: For input string: "201908241000gjjj"</code> is the previous string key of string key <code>201908261000ffghrr</code> which the child value changed:</p>
  
  <pre><code>{
      "Schedules": {
          "201908231000bb": {children}
          "201908241000gjjj": {children}   //NumberFormatException show this key
          "201908261000ffghrr": {children} //value changed
      }
  }
  </code></pre>
  
  <p>For any changes in children will show the Exception for the previous string key. If children changed in <code>201908241000gjjj</code>, then Exception show <code>201908231000bb</code>.
  And if children changed in <code>201908231000bb</code>, it have no error because <code>201908231000bb</code> is the first and have no previous string key for it.<br>
  Why is this weird things happen? Will the size of children influence this? I have another reference group have 3 children and String values for each child with no issue when Database changes but this reference group (Schedules) has about 34 children and String values for each child.</p>
  
  <p>I expect no matter how the value in database is changed, the activity will keep working, but it goes back to the previous activity and then pops up "Application not working" after any change in the referred database.</p>