首页 \ 问答 \ 在操作之间获取事件用户按通话按钮,当用户开始听到通话声音时(Getting event between actions user press call button and when user start hear call sounds)

在操作之间获取事件用户按通话按钮,当用户开始听到通话声音时(Getting event between actions user press call button and when user start hear call sounds)

我在TelephonyManager中发现了3个事件,但是如何测量手机需要连接用户的时间? 可能吗?

/** Device call state: No activity. */
    public static final int CALL_STATE_IDLE = 0;
    /** Device call state: Ringing. A new call arrived and is
     *  ringing or waiting. In the latter case, another call is
     *  already active. */
    public static final int CALL_STATE_RINGING = 1;
    /** Device call state: Off-hook. At least one call exists
      * that is dialing, active, or on hold, and no calls are ringing
      * or waiting. */
    public static final int CALL_STATE_OFFHOOK = 2;

I found 3 events in TelephonyManager, but how can I measure time that phone need to connect subscriber? Is it possible?

/** Device call state: No activity. */
    public static final int CALL_STATE_IDLE = 0;
    /** Device call state: Ringing. A new call arrived and is
     *  ringing or waiting. In the latter case, another call is
     *  already active. */
    public static final int CALL_STATE_RINGING = 1;
    /** Device call state: Off-hook. At least one call exists
      * that is dialing, active, or on hold, and no calls are ringing
      * or waiting. */
    public static final int CALL_STATE_OFFHOOK = 2;

原文:https://stackoverflow.com/questions/50911418
更新时间:2019-09-11 17:38

最满意答案

不,这是不可能的。 没有电话连接的事件广播,或者接听电话。


No, this isn't possible. There's no event broadcast for call connected, or call picked up.

2018-06-18

相关问答

更多

Rails 4 - 当用户按下浏览器后退按钮时更新特定数据(Rails 4 - Update a specific data when user press browser back button)

尝试使用call_back清除这样的响应缓存。 它会工作。 class ApplicationController < ActionController::Base before_filter :set_cache_headers private def set_cache_headers response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-reval ...

多线程 - 按钮单击事件 - 用户控制(Multithreading - Button Click Event - On User Control)

Thread.Sleep,哈? 看看你的规格(不是代码),我不会这样做。 扫描条形码并启动计时器。 每次用户及时点击“是”时重置计时器。 如果用户错过了机会,请停止接受用户输入并处理已扫描的内容。 您将需要一些表格关闭锁定以防止同时处理用户输入和计时器,并且您将摆脱不必要的Tread.Sleep。 Thread.Sleep, hah? Looking at your specs (not the code), I wouldn't go this way. Scan barcode and st

fbconnect注销按钮iphone sdk(fbconnect logout button iphone sdk)

显而易见且最简单的方法是了解按钮的状态。 如果用户已经被登录,则按钮的状态将显示“退出”,当用户单击它时,您只需处理事件并呼叫注销。 现在,您如何知道该用户已被注册? 在FBSonnect类中有一个FBConnect方法。 [_session isConnected]; 如果用户是loggined则返回true,如果user不是,则返回false。 而且我认为您已经将会话变量存储在某处以调用登录 The obvious and easiest way is to know what is the

根据用户操作将事件附加到事件(Append Procedure to Event upon User Action)

您无法动态分配事件处理程序。 Excel将始终调用内置事件处理程序( SelectionChange , Calculate等),并且无法替换您自己的事件处理程序。 但是,您可以使用WithEvents关键字创建自己的Worksheet变量,并选择何时开始接收事件。 例如,从您的一个工作表中的此结构开始: Dim WithEvents MySheet As Worksheet Private Sub MySheet_SelectionChange(ByVal Target As Range)

创建用户前的调用方法(Call method before creating user)

只需使用OnCreatingUser ,并设置e.Cancel = true; 如果电子邮件已经注册。 如果您为成员资格提供程序设置requiresUniqueEmail="true" ,它会为您执行此检查。 Simply use OnCreatingUser, and set e.Cancel = true; if e-mail is already registered. If you set requiresUniqueEmail="true" for the membership prov ...

离开时停止声音!(Stop Sounds When Leaving Frame! FLASH AS3)

你需要调用.stop(); 在clickListener中为按钮。 并且不会在下一帧中调用它,因为它将超出范围。 显示按钮的代码。 还要使用.stop(); 你必须将它附加到SoundChannel var mySound:Sound = new Sound(); var myChannel:SoundChannel = new SoundChannel(); mySound.load(new URLRequest("TickTock.mp3")); myChannel = mySound.pl

每次用户打开应用程序时都会调用OnSessionStateChange,并且他已经登录(OnSessionStateChange is called everytime user opens the app and he is already logged in)

每次会话状态更改时,都会调用StatusCallback.call()方法。 当您冷启动应用程序并创建一个Session对象时,它将经历几个状态更改,其中每个都将触发StatusCallback.call()。 您可以: 在LoginButton上设置一个OnClickListener,并监听点击事件(可能设置一些状态告诉你的应用程序未来的会话更改是通过点击按钮触发的),或者 将一个UserInfoChangedCallback添加到LoginButton,并将您的繁重工作放在该回调中(请注意,

PHP call_user_func_array:如何将所有参数作为单个数组传递?(PHP call_user_func_array: How to pass all parameters as a single array?)

很明显: call_user_func_array( [$this->controller, $this->method], [$this->params] ); It is obviously: call_user_func_array( [$this->controller, $this->method], [$this->params] );

相关文章

更多

最新问答

更多
  • .net Rx:消息的有序批处理(.net Rx: in-order batch-processing of messages)
  • 查询在给定区域中包含全景图的商业场所的api?(Query places api for business venues in given area which contain panoramas?)
  • linux启动的时候的两条进度条各表示在加载什么?
  • 测试是否已存在某些内容(Testing if something already exists)
  • iOS7和jQuery mobile:面板在打开和关闭后变为空白(iOS7 and jQuery mobile: panel goes blank once opened and closed)
  • 在Spring中结合GET和POST请求方法(Combine GET and POST request methods in Spring)
  • 从Geany内部运行应用程序的多个实例(Run multiple instances of an application from inside Geany)
  • 使用Yii2在邮件中嵌入图像时出错(Error when embed image in mail using Yii2)
  • 带有不同频率的LED计数器程序(0 - 15)(Led Counter Program (0 - 15) with different frequencies)
  • Google支持SAML 2.0 ECP(Google support for SAML 2.0 ECP)
  • 如何识别结构构件的尺寸?(How can i identify the size of structure member?)
  • 带有计数器的列表迭代中的Netlogo列表(Netlogo list in list iterations with counter)
  • Eclipse CDT中对函数的未定义引用(undefined reference to function in Eclipse CDT)
  • 如何确定一个类是否是java中接口的实现(How to determine if a class which is an implemenation of an interface in java)
  • Wireshark捕获过滤器示例(Wireshark Capture Filter Example)
  • 什么是NoSQL?(What exactly is NoSQL?)
  • 如何在sass中编写媒体查询?(How to write media queries in sass?)
  • spring destroy-method +请求范围bean(spring destroy-method + request scope bean)
  • ssis包中全局表的范围(Scope of Global Table in ssis package)
  • 如何在较小的屏幕上禁用Bootstrap的“词缀”?(How can I disable Bootstrap's “affix” on smaller screens?)
  • SQLite Min函数在使用String数据的行中返回NULL(SQLite Min function returns NULL in row with String data)
  • 如何在Cordova中更新应用程序版本(How to update app version in Cordova)
  • 当我在while循环中使用char []读取Android中的文本文件时出现重复行(repeated lines when I use char[] in while loop for reading text file in Android)
  • 有没有办法按顺序打印数组,在[TCL]中输入条目(Is there a way to print array in order with entries entered in that [TCL])
  • 如何在倒排索引结构中搜索短语查询?(How to search phrase queries in inverted index structure?)
  • 导致在WCF中返回HTTP错误状态(Causing HTTP error status to be returned in WCF)
  • qsqltablemodel不兼容的数据类型(qsqltablemodel incompatible data types)
  • 如何在没有包的情况下引用Java文件?(How can I reference Java files without packages?)
  • Rails 4.1.1相关模型属性,嵌套表单不保存(Rails 4.1.1 related model attribute with nested form not saving)
  • 如何将byte []转换成字符串?(How to convert UTF-8 byte[] to string?)