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
Hi, I notice in class RulesPreferenceFragment.java you have used function onAttach(Context), which is added in API version = 23. However, onAttach(Context) will not execute in API version < 23 (See this link).
Class RulesPreferenceFragment directly extends android.preference.PreferenceFragment. As the official document of Android shows, android.preference.PreferenceFragment directly extends android.app.Fragment, unfortunately in practice onAttach(Context) will not executed if one use android.app.Fragment. If you put some important operation into this function, the program may not execute normally in API<23.
My suggestion is simply changing android.preference.PreferenceFragment to android.support.v7.preference.PreferenceFragmentCompat, which have the same function as android.preference.PreferenceFragment, but does not have this potential compatibility issue.
The text was updated successfully, but these errors were encountered:
Hi, I notice in class
RulesPreferenceFragment.java
you have used functiononAttach(Context)
, which is added in API version = 23. However,onAttach(Context)
will not execute in API version < 23 (See this link).Class
RulesPreferenceFragment
directly extendsandroid.preference.PreferenceFragment
. As the official document of Android shows,android.preference.PreferenceFragment
directly extendsandroid.app.Fragment
, unfortunately in practiceonAttach(Context)
will not executed if one useandroid.app.Fragment
. If you put some important operation into this function, the program may not execute normally in API<23.My suggestion is simply changing
android.preference.PreferenceFragment
toandroid.support.v7.preference.PreferenceFragmentCompat
, which have the same function asandroid.preference.PreferenceFragment
, but does not have this potential compatibility issue.The text was updated successfully, but these errors were encountered: