0
我希望在systemTime等於特定值時立即執行newCradleLoading的停止方法。在特定日期執行操作時間
這裏我的僞代碼:
newtonCradleLoading.start();
Calendar rightNow = Calendar.getInstance();
Calendar en = Calendar.getInstance();
en.set(2015, 10, 20, 21, 48, 00);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formattedDate = df.format(rightNow.getTime());
String reqd = df.format(en.getTime());
while (formattedDate != reqd) {
rightNow = Calendar.getInstance();
formattedDate = df.format(rightNow.getTime());
}
newtonCradleLoading.stop();
的問題是,當我選擇要顯示該片段,應用程序凍結的選項。
庫可以發現在:https://github.com/yankai-victor/Loading
爲了使它更清楚,我想看到牛頓搖籃運行,直到SYSTEMTIME等於所需的時間和日期。
謝謝!
我因此未得到如何實現它在我的情況 –