i am running a small sequence of commands in my main_Activity.
this main activity starts another activity called subActivity periodically.
now after 20 seconds the subActivity stops and returns control to main_activity.
but the problem is other commands are automatically executed in the background.
for example : Send Sms >> Send Sms >> Send Sms
i want the second Send Sms to be executed only after 20 seconds(i.e only after the control is transferred from subActivity to main_Activity)
Code for main Activity
String arr[]={"send","receive"};
for (int i=0;i < arr.length;i++)
if(arr[i].equals("send"))
{
txtView.setText("sending a sms" );
return_value=0;
sendSMS("121","START");
Intent ii =new Intent("com.example.sendsmsdemo.WAITINGROOM");
startActivity(ii);
}
code of sub Activity //count down timer runs till 20 and the the finish() is called