I have this method from a separate class in which when the call ends, the color of my ImageView changes from red to white. Sample code below:
public void endOfCall(){
((Activity)mContext).runOnUiThread(new Runnable(){
@Override
public void run(){
TargetDetails.oncall.setVisibility(View.VISIBLE);
TargetDetails.endcall.setVisibility(View.GONE);
}
});
try{
call.endCall();
}catch (SipException se) {}
call.close();
if(true){
Thread.sleep(10000);
}
}
The problem starts when it goes into the "if" condition, where I put Thread.sleep. It waits 10 seconds before the code below is executed.
TargetDetails.oncall.setVisibility(View.VISIBLE);
TargetDetails.endcall.setVisibility(View.GONE);
I think there is something missing here regarding Thread.sleep. I just want to get rid of it, but I'm not sure about the alternative. Help. Thank.
source
share