1

I'm developing a ViewPager with several fragments, one of them I want it to be a "PreferenceActivity" the problem is that I'm using API7, so no PreferencesFragment... I've already search for a way to embed an activity (PreferencesActivity) in a Fragment, and given up for lack of results. So my next take is to "build" a preference activity Look and feel in a fragment, so my question is this how can I build an interface that looks just like the preference activity, more specifically a listPreferences lookalike (with the text title and description, icon, behavior, etc)?

Thanks very much for your help!

RMartins
  • 171
  • 1
  • 1
  • 6
  • take a look at http://stackoverflow.com/questions/5501431/was-preferencefragment-intentionally-excluded-from-the-compatibility-package – Gal Ben-Haim May 08 '12 at 21:14
  • Thanks Gal, I've already seen that post, I can't use that approach because of the pagerViwer that only alows fragments and not activities. – RMartins May 08 '12 at 22:27
  • "I'm developing a ViewPager with several fragments, one of them I want it to be a "PreferenceActivity"" -- IMHO, that is a flawed UI design, even if it were possible. – CommonsWare May 08 '12 at 22:57
  • I don't want a PreferenceActivity, I want a "PreferenceActivity", meaning something that looks like a preference activity and sort of works like one. A fragment that has the "PreferenceActivity" L&F. – RMartins May 09 '12 at 15:23
  • to allow the User to configure the app by sliding to the side and not in a new Activity.thx – RMartins May 09 '12 at 15:30

1 Answers1

0

Not exactly the answer the OP is looking for, but...

I have been researching for something very similar the last weeks and found that there is no perfect solution besides manually extending a ListFragment, or building a layout with a ListView, whichever best suits your re-usability needs. Then just instantiate/inflate the view or layout where you need it.

It's a shame that we can't use the standardized PreferenceActivity fragments, which would prevent theme and style duplication when having multiple settings like "General Settings" and "instance specific" settings (e.g. think external device configuration). In the later it is no bad practice at all to use in a tab, for instance. But then again it's bad practice to use other resources from PreferenceActivity on this "instance specific" screens, so I digress...

leRobot
  • 1,497
  • 1
  • 18
  • 30