gpt4 book ai didi

java - 无法解析方法askCompactPermission

转载 作者:行者123 更新时间:2023-12-02 02:13:38 27 4
gpt4 key购买 nike

我想通过特殊library请求权限

但是当我尝试在代码中传递此内容时,我收到此错误。

Look Please


我的代码:

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

askCompactPermission(PermissionUtils.Manifest_CAMERA, new PermissionResult() {
@Override
public void permissionGranted() {
//permission granted
//replace with your action
}

@Override
public void permissionDenied() {
//permission denied
//replace with your action
}
@Override
public void permissionForeverDenied() {
// user has check never ask again
// you need to open setting manually
openSettingsApp(MainActivity.this);
}
});


}}

最佳答案

似乎您直到最后都没有按照说明进行操作,因为您链接的指南说您的 Activity 必须扩展“ActivityManagePermission”,它定义了“askCompactPermission”方法,并且您正在扩展“AppCompatActivity”,它解释了您看到的错误...

关于java - 无法解析方法askCompactPermission,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49601202/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com