我开始了一个电话活动请求结果:
Intent intentcall = new Intent();
intentcall.setAction(Intent.ACTION_CALL);
intentcall.setData(Uri.parse("tel:" + phoneNumber));
this.startActivityForResult(intentcall, REQUEST_SLIPDROP_ICON_OFF);
然后在电话监听器中设置结果,如下所示:
private class MyPhoneStateListener extends PhoneStateListener{
public void onCallStateChanged(int state, String incomingNumber) {
super.onCallStateChanged(state, incomingNumber);
switch (state) {
case TelephonyManager.CALL_STATE_IDLE:
setResult(Activity.RESULT_OK);
break;
最后我想关闭onActivityResult中的图标,但没有任何反应。
switch (requestCode) {
case REQUEST_SLIPDROP_ICON_OFF:
Log.d("request icon off", "request icon off");
if (resultCode == Activity.RESULT_OK) {
changeMenuItem(R.id.fall, R.drawable.fall);
slipAndDropIconOn = false;
}
break;
哪里不对了?请指教!谢谢你