Android的 - 拨号器图标被放置在最近使用过的应用程序完成后()使用过、应用程序、图标、最近

2023-09-12 06:08:18 作者:哥的幸福迷茫

在我的应用程序检测出正在进行的呼叫时,呼叫从拨号或联系人拨号。

In my application I detect the out going call when a call is dialled from the dialer or contacts.

这工作得很好,然后我弹出一个对话框说我已经检测到的呼叫,然后用户presses一个按钮来关闭它要求在该活动结束()对话框。

This works fine and I then pop up a dialog saying I have detected the call and then the user presses a button to close the dialog which calls finish() on that activity.

这一切工作正常,只是当我再按住home键调出最近使用的应用程序拨号器图标是存在的。

It all works fine except that when I then hold the home key to bring up the recently used apps the dialer icon is there.

而当它被点击时带来的对话框回成焦点在前台当对话活动应该是死了,不能够被带回前台。

And when it is clicked the dialog is brought back into focus in the foreground when the dialog activity should be dead and gone and not be able to be brought back to the foreground.

下面是我的意思的图片。

Here is a picture of what I mean.

于是出现了两个问题,为什么会拨号器图标会越来越摆在那里,为什么它会被召回我的活动前景?

So two questions arise, why would the dialer icon be getting placed there and why would it be recalling my activity to the foreground?

下面是$ C $下的活动有一个对话的主题:

Here is the code for that Activity which has a dialog theme:

 public class CallDialogActivity extends Activity{

 boolean isRecording;
 AudioManager audio_service;

 public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.dialog);
      audio_service = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
      getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);



      Bundle b = this.getIntent().getExtras();
      String number = b.getString("com.networks.NUMBER"); 
      String name = b.getString("com.networks.NAME"); 

      TextView tv = (TextView) findViewById(R.id.voip) ;
      tv.setText(name);

      Intent service = new Intent(CallAudio.CICERO_CALL_SERVICE);
         startService(service);

      final Button stop_Call_Button = (Button) findViewById(R.id.widget35);


      this.setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);


        stop_Call_Button.setOnClickListener(new View.OnClickListener(){
  public void onClick(View v){


   Intent service = new Intent(CallAudio._CALL_SERVICE);

   //this is for Android 1.5 (sets speaker going for a few seconds before shutting down)


   stopService(service);
   Intent setIntent = new Intent(Intent.ACTION_MAIN);
         setIntent.addCategory(Intent.CATEGORY_HOME);
   setIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
   startActivity(setIntent); 
          finish();
             isRecording = false;

   }

 });

        final Button speaker_Button = (Button) findViewById(R.id.widget36);

         speaker_Button.setOnClickListener(new View.OnClickListener(){
       public void onClick(View v){

        if(true){
         audio_service.setSpeakerphoneOn(false);
        }
        else{
         audio_service.setSpeakerphoneOn(true);
        }

       }

      });

}

@覆盖       保护无效onResume(){           super.onResume();

@Override protected void onResume() { super.onResume();

  }

  @Override
  protected void onPause() {

      super.onPause();
  }

  public void onCofigurationChanged(Configuration newConfig) { 

   super.onConfigurationChanged(newConfig); 

   }

}

它要求使用AudioRecord从麦克风和AudioTrack录制服务,发挥它的听筒,没有什么做的拨号服务。

It calls a service that uses AudioRecord to record from the Mic and AudioTrack to play it out the earpiece, nothing in the service to do with the dialler.

有没有人任何想法,为什么这可能发生?

Has anyone any idea why this might be happening?

推荐答案

经过一番研究,看来HTC的执行拨号器中有一些错误,拨号器图标不应该出现的手机应该是压倒一切的。

After some research it seems HTC's implementation of the dialer has some bugs in it, the dialer icon should never appear as the phone should be overriding it.