English 中文(简体)
如何避免火灾 TelephoneStateListener.CALL_STATE_RINGING 如果已经交谈过,第二打电话者正在打电话。
原标题:How to not fire PhoneStateListener.CALL_STATE_RINGING if already talking and a second caller is calling

I am programming an app, that automatically answers a call. The problem is, that it should not answer one if I am already in a call and someone is ringing. Is there a way to achieve that?

根据该准则,如果我对<代码>TelephonyManager的状况进行核对,将改为CALL_STATE_RING,而不是CALL_STATE_OFFTHEHOOK

我是否必须增加一个变化中的电话国真实的变量,以便我知道,目前有人呼吁,或者是否有更好的解决办法?

Thanks!

/edit: I answer the call without the permission Modify_Phone_State, so it is only about finding out if there is already a call ongoing.

最佳回答

奥凯,由于显然无法从中看出这一点,一旦国家进入(true)之后,我就将一个诱杀装置储存在共同参比中。

当国家修改<代码>IDLE时,我把“Bolean”定为假。 因此,如果在有人已经打电话时发射“<0<>RING<>>>,我宣读,变量是真实的,然后放弃以下行动。

For those who want more information on how to answer a call, have a look at the AutoAnswer Project

问题回答

跟踪海流的最佳方式,因为你的问题偏离了海底标准。

您的问题没有正式答案,因为:

By the Android API there is no official way for a third party application provider to answer to a phone call because
1 : you ve to use undocumented API.
2 : request MODIFY_PHONE_STATE permission is only available for rooted/system signed application since 2.3

因此,如果对您的问题有有效的(在代码上签字)工作答案,那么它可能正式不为每个制造商/模仿装置工作。

https://stackoverflow.com/questions/4715250/how-to-grant-modification-phone-state-permission-for-apps-ran-on-gingerbread> • 如何批准MODIFY_PHONE_STATE在Gingerbread上收看。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签