我在Android Studio中遇到错误

发布于 2025-02-12 21:20:51 字数 558 浏览 1 评论 0原文

我是Android Studio的新手,并且在Android Studio中遇到了错误。我该如何解决?

protected void onCreate(final Bundle bundle) {
        if (Build.VERSION.SDK_INT >= 30){
            if (!Environment.isExternalStorageManager()){
                Intent getpermission = new Intent();
                getpermission.setAction(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
                startActivity(getpermission);
            }
        }
}

错误屏幕快照

I'm new in Android Studio and i am getting errors in Android Studio. How can I fix this?

protected void onCreate(final Bundle bundle) {
        if (Build.VERSION.SDK_INT >= 30){
            if (!Environment.isExternalStorageManager()){
                Intent getpermission = new Intent();
                getpermission.setAction(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION);
                startActivity(getpermission);
            }
        }
}

error screenshot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

标点 2025-02-19 21:20:51

导入您在代码中使用的类,

例如,如果要使用意图,请像这样将其导入:

在您的导入语句中添加此行

import android.content.Intent;

,否则您只需悬停在代码中的错误上,然后单击“导入类”

Import the classes you are using in your code,

For e.g. if you want to use intent then import it like so:

Add this line in your import statements

import android.content.Intent;

or else you can just hover over the error in your code and click on "Import class"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文