在我的应用程序检测出正在进行的呼叫,当呼叫从拨号器或触点拨打。

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

它所有的工作只是罚款当我再按住home键调出最近使用的应用程序拨号图标是存在的。

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

下面是我的意思的画面。

拨号错误http://img515.imageshack.us/img515/8505/devicev .PNG

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

下面是该活动具有对话主题的代码:

 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 onPause() {

      super.onPause();
  }

  public void onCofigurationChanged(Configuration newConfig) { 

   super.onConfigurationChanged(newConfig); 

   }

}

它调用使用AudioRecord从麦克风和AudioTrack记录服务,在服务做的拨号器打出来的耳机,什么都没有。

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

有帮助吗?

解决方案 2

一些研究似乎HTC的执行拨号器中有一些错误之后,拨号器图标不应该出现的手机应该是覆盖它。

其他提示

如果应用程序已经完成最近使用的应用程序菜单并不关心。它如果是的话只是重新启动它。它显示当前正在运行的事情,近来已经使用的,不是物。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top