Home > database >  I'm getting errors in Android Studio
I'm getting errors in Android Studio

Time:07-04

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

CodePudding user response:

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"

  • Related