/** * Choosing which date must be shown depending on sorting criteria * * @return String ith formatted date */ public static String getDateText(Context mContext, Note note) { String dateText; SharedPreferences prefs = mContext.getSharedPreferences(Constants.PREFS_NAME, mContext.MODE_MULTI_PROCESS); String sort_column = prefs.getString(Constants.PREF_SORTING_COLUMN, ""); // Creation if (sort_column.equals(DbHelper.KEY_CREATION)) { dateText = mContext.getString(R.string.creation) + " " + note.getCreationShort(mContext); } // Reminder else if (sort_column.equals(DbHelper.KEY_ALARM)) { String alarmShort = note.getAlarmShort(mContext); if (alarmShort.length() == 0) { dateText = mContext.getString(R.string.no_reminder_set); } else { dateText = mContext.getString(R.string.alarm_set_on) + " " + note.getAlarmShort(mContext); } } // Others else { dateText = mContext.getString(R.string.last_update) + " " + note.getLastModificationShort(mContext); } return dateText; }