Android: method call expected error

2020-04-20 08:45发布

问题:

I've searched internet for that error and have not found right answer. I've got error saying "method call expected" on mPrefsKeys in bindPreferenceSummaryToValue(findPreference(mPrefsKeys(i)))

public final static String [] mPrefsKeys = new String[]{"username", "devicename"}
bindPreferenceSummaryToValue(findPreference(mPrefsKeys(i)))

public Preference findPreference(CharSequence key) {
    if (mPreferenceManager == null) {
        return null;
    }
    return mPreferenceManager.findPreference(key);
}

What that error means?

回答1:

I spent significant effort to search for the answer what that error means.

Then somehow reading something (Java Method Call Expected) I was enlighted: array items should be referenced with [], not ().