OnSharedPreferenceChangeListener never receives callback

by Mark Murphy » Wed, 16 Jun 2010 04:29:32 GMT


Sponsored Links
 


It shouldn't be. It works in services, and services never have the focus.


Try using "this" instead of "getApplicationContext()"

-- 
Mark Murphy
CommonsWare
mmur...@commonsware.com
 http://commonsware.com 

--



OnSharedPreferenceChangeListener never receives callback

by Connick » Wed, 16 Jun 2010 04:40:32 GMT


 No effect. I'm registering the listener in onCreate of my activity, not sure
if that has any implications. I've also been assuming this should fire when
prefs are either changed via a pref activity and/or when a commit is called
from a shared pref editor?

-Stace







>


Sponsored Links


OnSharedPreferenceChangeListener never receives callback

by Mark Murphy » Wed, 16 Jun 2010 04:42:42 GMT


 


Correct.

-- 
Mark Murphy
CommonsWare
mmur...@commonsware.com
 http://commonsware.com 

--



OnSharedPreferenceChangeListener never receives callback

by Connick » Wed, 16 Jun 2010 04:43:05 GMT


 Interesting, it only works if used within an activity that extends
PreferenceActivity. Crap.







>>



OnSharedPreferenceChangeListener never receives callback

by Mark Murphy » Wed, 16 Jun 2010 04:46:40 GMT


 


So long as all components are using the same preference file, it
should work for modifications from any source. That is what I meant by
"correct" in my previous reply.

-- 
Mark Murphy
CommonsWare
mmur...@commonsware.com
 http://commonsware.com 

--



OnSharedPreferenceChangeListener never receives callback

by Connick » Wed, 16 Jun 2010 05:18:50 GMT


 Will file a big, thx!






>



OnSharedPreferenceChangeListener never receives callback

by Connick » Wed, 16 Jun 2010 05:53:13 GMT


 Cancel that, I just grasped what you were getting at. :)







>>



Other Threads

1. build JNI C code fail ???

Why build error?

build and Error Message:
.../mydroid$ make libmax
target thumb C: libmax <= development/max/max.c
development/max/max.c: In function 'Java_testdll_set':
development/max/max.c:7: error: parameter name omitted
development/max/max.c:7: error: parameter name omitted
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/
libmax_intermediates/max.o] Error 1

code as follows:

max.c
=======================================================================
#include <jni.h>
JNIEXPORT void JNICALL Java_testdll_set (JNIEnv *, jclass, jint);

 int i = 0;

    JNIEXPORT void JNICALL Java_testdll_set (JNIEnv *, jclass, jint
j)
      {
       i = j;
      }
=======================================================================

Android.mk
================================
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \

    max.c

LOCAL_C_INCLUDES := \

    $(JNI_H_INCLUDE)

LOCAL_SHARED_LIBRARIES := \

    libutils

LOCAL_PRELINK_MODULE := false

LOCAL_MODULE := libmax

include $(BUILD_SHARED_LIBRARY)
==================================

--~--~---------~--~----~------------~-------~--~----~

2. Layout question - how to replicate what the iPhone does...

Hi there,

I have an application that consists of a series of tasks, and I'm
struggling to replicate a user experience that is simple to implement
on the iPhone.

In the abstract: on the home screen, I'd like there to be a list of
four tasks, of various kinds.

-- Two will invite the user to click on them, with an arrow. When they
are complete, they show a tick.
-- One task is dependent on the others, so it will be greyed out until
the others are completed. Then it looks like the others.
-- Another task runs in the background, so it has a progress icon
running until it's finished, instead of an arrow.

To show what I mean concretely, this is the application that I'm
trying to replicate - check out the home screen: 
http://www.fixmystreet.com/iphone/

How would I even start to create a home screen that looks like this in
Android? Essentially I need clickable areas with text and icons.
Buttons can't have images attached, nor can they be greyed out. Maybe
a List... but you can't attach checkboxes or progress indicators to
individual items. Is a series of WebViews the best way?

Or should I use something radically different like a TabWidget? I do
like the layout here, though...

Can anyone help? I'm really struggling to know what to do!

Thank you for your help!

Anna
--~--~---------~--~----~------------~-------~--~----~

3. Handler for map panning

4. Making VideoView play automatically

5. Is anyone else getting bored of announced product releases that don't materialise ...

6. cupcake 1.5 r1 surfaceCreated is not called!!!

7. TabHost launching Intent multiple times