結果を要求する電話アクティビティを開始しました:
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;
何か間違っていますか?お知らせ下さい!ありがとうございました