我一直在想幾個小時,但我覺得沒辦法,沒有解決方案,任何機構能幫助我還是給我一個合理的想法?或一些代碼行?當我嘗試第二次登錄時,我得到了更多的時間並增加了24小時額外的時間,但它不適合我。 這是我獲得當前時間的代碼。如何檢查用戶只能在一天Android中登錄一次?
public void getTime() {
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
String strDate = sdf.format(c.getTime());
time = strDate.replace(":", "");
previous_time = Integer.parseInt(time);
saveToSharesPre(previous_time + 2400);
return;
}
thanx對於這麼好的邏輯 –