Customizing Preference page by mixing preferences with view widgets | Techbirds

1. Create a layout that include a listView and any other view widgets you want in your preference page.

2. Now Create a preferences xml file, from which any preferences will be attached to the screen.

(mypreference.xml).

3. You can now attach both the layout (containing the view widgets) and the preferences (that will replace the list view from the layout file).

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); addPreferencesFromResource(R.xml.mypreferences);

}

649 total views, 2 views today

Share this Onfacebook-1421014twitter-1852297linkedin-6371010google-4242345