Play directly in the method Calendar C = calendar.getinstance (); Get Current year String myear = string.valueof (C.get (calendar.year)); Get Current Month String mmonth = string.valueof (C.get (calendar.month) + 1); Get the date number for the current month String mday = string.valueof (C.get (calendar.day_of_month)); Get the current week he's got the numbers. 1 2 3 4 5 6 So, based on the numbers, String Mway = string.valueof (C.get (Calendar.day_of_week)); if ("1". Equals (Mway)) { Mway = "Day"; } else if ("2". Equals (Mway)) { Mway = "one"; } else if ("3". Equals (Mway)) { Mway = "two"; } else if ("4". Equals (Mway)) { Mway = "three"; } else if ("5". Equals (Mway)) { Mway = "Four"; } else if ("6". Equals (Mway)) { Mway = "Five"; } else if ("7". Equals (Mway)) { Mway = "Six"; } TextView Assignment Value Date.settext (Myear + "." + Mmonth + "." + Mday + "Week" + mway+ "" + "Today"); |
|
|
|
Android Displays the current time at anytime