i have an application making a call for specific phone number, if the number not response the application make an action, my question is: how can i know if the there is a response or not ?!
here is my code:
PhoneCallListener phoneListener = new PhoneCallListener();
TelephonyManager telephonyManager = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.listen(phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
Button emr = (Button) findViewById (R.id.emergButton);
emr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Model m = new Model () ;
num=m.getAdminPhone();
String Numb = "tel:"+num;
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse(Numb));
startActivity(callIntent);
if () // here i want to making a check...
{answer = true;}
}
});