在 python3 kivy 中使用您的应用程序进行调用

问题描述 投票:0回答:1

嗨,有谁知道如何在 kivy 中使用意图来创建一个拨打电话号码的函数吗?预先感谢您。

这是我尝试做这件事,这是正确的还是我必须添加其他东西?

from jnius import autoclass

Intent = autoclass('android.content.Intent')
Uri = autoclass('android.net.Uri')
call = None


def call_number(self):
    call = self.Intent()
    call.setAction(self.Intent.ACTION_CALL)
    call.setData(self.Uri.parse("tel:%s" % int(host_number)))
    self.startActivity(call)
python python-3.x kivy kivy-language
1个回答
0
投票

看起来您可以使用 kivy plyer 库来实现此目的。有一个专门的调用示例here

基于此,看起来你应该能够做到

import plyer

plyer.makecall("<phone number goes here>")
plyer.dialcall()
© www.soinside.com 2019 - 2024. All rights reserved.