Android 如何在电话端启动活动?

Android 如何在电话端启动活动?,android,eclipse,Android,Eclipse,我有一个应用程序,允许用户将手机借给要求使用手机拨打电话的人。它与编辑文本和按钮一起工作 这是电话号码: button1 = (Button)findViewById(R.id.button1); setEditText1((EditText)findViewById(R.id.editText1)); button1.setOnClickListener(this); {}} public void onClick(View arg0) {

我有一个应用程序,允许用户将手机借给要求使用手机拨打电话的人。它与编辑文本和按钮一起工作

这是电话号码:

button1 = (Button)findViewById(R.id.button1);
    setEditText1((EditText)findViewById(R.id.editText1));
    button1.setOnClickListener(this); {}}


            public void onClick(View arg0) {

                EditText num=(EditText)findViewById(R.id.editText1);
                String number = "tel:" +num.getText().toString().trim();
                Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse(number));
                startActivity(callIntent);
            }

我想做的是这样,当客人结束电话时,它会进入密码活动。我该怎么做呢?

你可以使用
TelephonyManager
PhoneStateListener
并覆盖
onCallStateChanged
,这样当状态变为
CALL\u state\u IDLE
时,你就可以开始你的活动了。请你改写这句话:
我有一个代码,允许用户把手机借给我要求使用手机打电话的人。
我指的是应用程序,很抱歉