I wish to execute the stop method of newCradleLoading as soon as the systemTime equals a specific value.
Here my pseudo code:
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();
the problem is that as soon as I select the option to display this fragment , the app freezes.
The library can be found at : https://github.com/yankai-victor/Loading
To make it more clear I want to see Newton Cradle running , until systemTime equals the required time and date.
Thanks!