如何创建打开"呼叫日志活动"的Intent?

Jan*_*usz 8 android calllog android-intent

我想创建一个Intent,打开屏幕显示当前设备的通话记录?

我如何指定这样的意图?

Jan*_*usz 27

Barmaley通过将类型设置为Calls.ContentType将我引导到正确的路径.

Intent showCallLog = new Intent();
showCallLog.setAction(Intent.ACTION_VIEW);
showCallLog.setType(CallLog.Calls.CONTENT_TYPE);
context.startActivity(showCallLog);           
Run Code Online (Sandbox Code Playgroud)

这个意图应该成功.

  • 真的说从来没有试过我的代码,只是根据我的感受写出来...... (2认同)
  • @Janusz 是的,正确的,因为谷歌的这一举动将影响很多应用程序。在真正需要此权限之前,我们无法填写表单并向 Google 请求允许此权限。由于谷歌的大量变化,开发者遭受了很大的痛苦。每天都有新的事情发生。 (2认同)

Bar*_*ica 7

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("content://call_log/calls")); 
Run Code Online (Sandbox Code Playgroud)