0
我有一個應用程序撥打特定電話號碼的電話號碼,如果號碼沒有響應應用程序做出行動,我的問題是:我如何知道是否有響應或不響應?!如何檢查是否有響應
這裏是我的代碼:
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;}
}
});