You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Simple @SharedPref with APPLICATION_DEFAULT scope creates unused field #1030
With the following simple preferences interface, there is an unused "private Context context_" in the generated class that the compiler generates a warning for:
@SharedPref(value = Scope.APPLICATION_DEFAULT)
public interface Prefs {
String a();
This is normal. If you would use the keyRes parameter that field would be utilized. For simplicity, we always generate that field. Generally you should ignore warnings in generated classes.
With the following simple preferences interface, there is an unused "private Context context_" in the generated class that the compiler generates a warning for:
@SharedPref(value = Scope.APPLICATION_DEFAULT)
public interface Prefs {
String a();
}