From 52fb5f9fb0da9fa9ebb0715959cb7cd31ea9a0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Stankovi=C4=87?= Date: Thu, 20 Aug 2015 23:09:10 +0200 Subject: [PATCH] Replace getActivity() with context After some research, I found out that DateFormat.is24HourFormat actually accepts Context. --- .../main/java/com/moez/QKSMS/common/utils/DateFormatter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QKSMS/src/main/java/com/moez/QKSMS/common/utils/DateFormatter.java b/QKSMS/src/main/java/com/moez/QKSMS/common/utils/DateFormatter.java index 4eafa979..16700b04 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/common/utils/DateFormatter.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/common/utils/DateFormatter.java @@ -55,7 +55,7 @@ public abstract class DateFormatter { public static SimpleDateFormat accountFor24HourTime(Context context, SimpleDateFormat input) { //pass in 12 hour time. If needed, change to 24 hr. SharedPreferences prefs = MainActivity.getPrefs(context); - boolean isUsing24HourTime = prefs.getBoolean(SettingsFragment.TIMESTAMPS_24H, DateFormat.is24HourFormat(getActivity())); + boolean isUsing24HourTime = prefs.getBoolean(SettingsFragment.TIMESTAMPS_24H, DateFormat.is24HourFormat(context)); if (isUsing24HourTime) { return new SimpleDateFormat(input.toPattern().replace('h', 'H').replaceAll(" a", ""));