Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findPreference return null in api 10 #12

Open
sku4 opened this issue Dec 25, 2014 · 0 comments
Open

findPreference return null in api 10 #12

sku4 opened this issue Dec 25, 2014 · 0 comments

Comments

@sku4
Copy link

sku4 commented Dec 25, 2014

public class SettingsFragment extends PreferenceFragment implements OnPreferenceClickListener {
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.preferences);
        Preference prefAbout = (Preference) findPreference(PREFERENCE_ABOUT_KEY);

findPreference(PREFERENCE_ABOUT_KEY) return null only in api 10
in api 16+ working good

        prefAbout.setOnPreferenceClickListener(new OnPreferenceClickListener() {
            @Override
            public boolean onPreferenceClick(Preference preference) {
                AboutDialogFragment af = new AboutDialogFragment();
                af.show(getFragmentManager(), TAG_DIALOG_ABOUT);
                return true;
            }
        });
        .......
    }
        .......
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant