title: How to fix Lint's "[deprecation] locale in Configuration has been deprecated" warning
body: <p>Hopefully this is not a duplicate of the many other questions regarding the locale deprecated <code>context.getResources().getConfiguration().locale</code> call as I already fixed it. </p>
  
  <p>How would I get rid of the Lint warning for the following code:</p>
  
  <pre><code>public static String toDateString(Context context, Date date)
  {
      DateFormat format = Build.VERSION.SDK_INT &gt;= 24 ?
              DateFormat.getDateInstance(DateFormat.MEDIUM, context.getResources().getConfiguration().getLocales().get(0)) :
              DateFormat.getDateInstance(DateFormat.MEDIUM, context.getResources().getConfiguration().locale);
      return format.format(date);
  }
  </code></pre>