Tuesday, July 17, 2012

Re: [android-developers] Preferences button to return to main activity

On Tue, Jul 17, 2012 at 8:10 PM, billb <bill@briskynet.com> wrote:
I have overridden the Preference class onClick method with the below, however, I set a breakpoint that is never reached.

Can't help you there as I've never extended Preference and tried what you're doing. I'll reiterate that you can just use findPreference. Even if it is deprecated, it's not going away any time soon and you'll achieve what you're after in 1 line of code and about 30 seconds.

findPreference("pref").setIntent(new Intent(...));

Done.

Later, when you have time, you can refactor it to do it "correctly" using the fancy new Fragments stuff.

Deriving a custom Preference class for the explicit purpose of handling one very specific action on clicking it is kinda overkill, IMO.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices

--
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

No comments:

Post a Comment