I have the following code:
String state= bundle.getString(TelephonyManager.EXTRA_STATE);
if (state.equalsIgnoreCase(TelephonyManager.EXTRA_INCOMING_NUMBER)
{
Toast toast= new Toast(context);
toast.setGravity(Gravity.TOP,0,0);
toast.setDuration(Toast.Length_LONG);
toast.makeText(..).show();
toast.show();
}
I need to keep the toast up until the person answers to the phone. How to do that? I know I have to create and start a thread when I have incoming number and stop the thread when the person answers. how to accomplish this?
thx