Static context

How to create static context in Android Studio without error message.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="your.package.name">
    <application
        android:name="your.package.name.App">
        
    </application>
</manifest>

your.package.name.App.java

package your.package.name;

import android.app.Application;
import android.content.Context;
import java.util.ArrayList;
import java.util.List;

public class App extends Application {
    private static List<Context> context = new ArrayList<>();

    @Override
    public void onCreate() {
        super.onCreate();
        context.add(0, getBaseContext());
        context.add(1, getApplicationContext());
        context.add(2, getBaseContext().getApplicationContext());
    }

    public static Context getAppContext(int i){
        if(i < context.size())
            return context.get(i);
        return null;
    }
}