Customizing Preference page by mixing preferences with view widgets | Techbirds
Posted on: September 5, 2017 /
Categories: Mobile Applications
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 On