嗨,有谁知道如何在 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)
看起来您可以使用 kivy plyer 库来实现此目的。有一个专门的调用示例here
基于此,看起来你应该能够做到
import plyer
plyer.makecall("<phone number goes here>")
plyer.dialcall()