Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想代替用户转到设置>安全>屏幕固定,用户单击我的应用程序或磁贴服务中的按钮来打开/关闭屏幕固定。
我该怎么办?
您可以使用在按钮单击时触发的以下代码
setKioskPolicies(false, isAdmin) val intent = Intent(applicationContext, MainActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) } intent.putExtra(LOCK_ACTIVITY_KEY, false) startActivity(intent);