Hi i want to execute one method and take some time and then ececute run another method.Is there any possibility for this in handler .Give me some suggestions.Thanks in advance. I am using the below code in handlers but it is not working properly.
RefreshHandler extends Handler {
public void handleMessage(Message msg) {
FirstLevelMaths.this.updateUI();
FirstLevelMaths.this.updateUI1();
}
public void sleep(long delayMillis) {
this.removeMessages(0);
if(isUpdateUI)
sendMessageDelayed(obtainMessage(0), delayMillis);
}
}
private void updateUI(){
try
{
getimages();
mRedrawHandler.sleep(5000);
}
catch (Exception e) {
e.printStackTrace();
}
finally
{
System.gc();
System.runFinalization();
}
}
public void updateUI1() { try { getimages1(); mRedrawHandler.sleep(5000);
}
catch (Exception e) {
e.printStackTrace();
}
finally
{
System.gc();
System.runFinalization();
}
}
public void updateUI1() {
try
{
getimages1();
mRedrawHandler.sleep(5000);
}
catch (Exception e) {
e.printStackTrace();
}
finally
{
System.gc();
System.runFinalization();
}
}
I this getImages() and getimages1() are two methods