How to solve the issue of non-static and cannot accessed from a static context

When using for Ringtone it works but any other api the following error accours


object GetAccounts(Context c,object[] args){
        //var ring = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
        var accounts = AccountManager.getAccounts();
        return null;


'' is non-static and cannot be accessed from a static context

Why is that so?


As the error message says the getAccounts() is not static so you need to create an AccountManager instance first. How would you do this natively on Android?