I trying to find out is it thread safe to use
DateFormat dateFormat =android.text.format.DateFormat.getDateFormat(getApplicationContext());
I’m well aware that object DateFormat is not thread safe, but the previous snippet seems quite popular way for writing android programs e.g. How do you format date and time in Android?, and I haven’t noticed any mention of the threading issue.
android.text.format.DateFormatis a mix of it’s own functionality andjava.text.SimpleDateFormat. See for yourself: http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/base/core/java/android/text/format/DateFormat.javaAs far as I see, it’s
format(..)methods do not useSimpleDateFormatnor does it use any instance fields (just some static fields are read), so they should be thread-safe.