首页 > 解决方案 > 如何为 Andoid<=28 实现 CallScreeningService

问题描述

**到目前为止我做了什么:**

我已经为 Android SDK 29 实现了它

 RoleManager roleManager = (RoleManager) getSystemService(ROLE_SERVICE);
 Intent intent = roleManager.createRequestRoleIntent(RoleManager.ROLE_CALL_SCREENING);
 startActivityForResult(intent, REQUEST_ID1);

**我在找什么?: **

我想为 < SDK 29 的设备实施呼叫筛选服务。如果有人以前做过,请帮助我。

标签: javaandroidandroid-studiocallblockingcallscreeningservice

解决方案


不幸的是,你不能。

在 Android 版本 < 29 上无法访问RoleManager该类,因为该类是在 Android 29 上引入的。因此,您只能在运行 Android 29 及更高版本的设备上使用该类。


推荐阅读