I just can’t understand why I am getting this error, I am doing the same thing in another class and it works fine (maybe this is import?)
I want to do this:
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
String downloadKey = getString(R.string.pref_download_folder_key);
String downloadDefault = getString(R.string.pref_download_folder_default);
DownloadFolder = sharedPref.getString(downloadKey, downloadDefault);
But I get the following error:
Incorrect argument counting, pref_download_folder format string requires 0, but formats supplies 1
When I change the line to this, everything works fine (note that downloadDefault works despite the same method):
DownloadFolder = sharedPref.getString("pref_download_folder", downloadDefault);
Thanks in advance!
source
share