compare Date in Android : Hello im trying to compare two date in android but im getting this notification

   [notification][1]

when i write this



        SimpleDateFormat sdf = new SimpleDateFormat("ddMMyyyy");
        String valid_until = "26052018";
        final Date strDate = sdf.parse(valid_until);


and if i put the try and catch like this
[try n catch][2]

i cant compare the date because it say i didnt declared strDate
[cant compare][3]


  [1]: https://i.stack.imgur.com/DsNCX.png
  [2]: https://i.stack.imgur.com/FUwzz.png
  [3]: https://i.stack.imgur.com/neXZb.png