Wednesday, March 6, 2013

Re: [android-developers] Re: how to tell why Activity.onPause() is called

Forget about the whole preference stuff... just do it all manually, you'll have more control of the UI this way anyhow.
Use write your own UI that just handles SharedPreferences on its own.

On Tuesday, March 5, 2013 11:29:55 PM UTC+2, latimerius wrote:
On Tue, Mar 5, 2013 at 6:25 PM, Latimerius <l4t1m...@gmail.com> wrote:
On Tue, Mar 5, 2013 at 5:41 PM, Piren <gpi...@gmail.com> wrote:
- Dont use a different Activity to show Prefs (you can re-use your current one, i personally always disliked the PreferencesActivity class.. its ugly as fuck)
 
you can either just replace your current contentView or use other containers like ViewSwitcher/ViewPager and etc  to switch between the main app and the preferences view. 

Thanks for pointing this out, it never occurred to me that I could reuse my main activity instance... clever. :-)  Now trying to figure out how to construct the preferences view.  I'm also using PreferenceActivity.onSharedPreferenceChanged() so I'll have to have a replacement for that too.


Alas, it doesn't seem to be easy to inflate a preferences XML into a View hierarchy (this link http://stackoverflow.com/questions/4642858/how-to-display-preferences-in-a-view even suggests it's not possible at all!), let alone get the whole preferences machinery working outside of PreferenceActivity.

Have you actually done it, or are you just assuming it should be doable?

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment