Why corsor need to call setNotificationUri when query from content provider?

by 榛冨啝瀹 » Tue, 28 Apr 2009 09:36:06 GMT


Sponsored Links
 Hi,I don't got what you mean.

    @Override
    public Cursor query(Uri uri, String[] projection, String
selection, String[] selectionArgs,
            String sort) {
        SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
        qb.setTables(TASKS_TABLE);
        String orderBy;

        if (TextUtils.isEmpty(sort)) {
            orderBy = TASK_COMPLETED + " DESC" + ", " + TASK_PRIORITY
+ ", " + TASK_ID;
        } else {
            orderBy = sort;
        }

        switch (mURIMatcher.match(uri)) {
            case TASKS_SINGLE:
                qb.appendWhere(TASK_ID + "=" + uri.getPathSegments().get(1));
                break;
            default:
                break;
        }

        Cursor c = qb.query(mTasksDb,
                projection,
                selection, selectionArgs,
                null, null,
                orderBy);

            c.setNotificationUri(getContext().getContentResolver(), uri);


        return c;
    }

In above query implementation for content provider,
can I delete the line c.setNotificationUri(getContext().getContentResolver(),
uri) ??
thanks

2009/4/22 Marco Nelissen <marc...@android.com>




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



Why corsor need to call setNotificationUri when query from content provider?

by Eric Chen » Tue, 28 Apr 2009 11:43:16 GMT


 How about Update , it is need followed by setNotificationUrl?
Best Regards

Eric Chen







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


Sponsored Links


Why corsor need to call setNotificationUri when query from content provider?

by Marco Nelissen » Tue, 28 Apr 2009 12:06:51 GMT


 



You can certainly do that if you want to, but if you do, then you won't be
notified if someone goes and modifies the data.

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



Other Threads

1. Build Android fail with: /usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../x86_64-slamd64- linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../

I have tried to compile Android on my host machine:

        Manufacturer: Hewlett-Packard
        Product Name: HP Pavilion dv6500 Notebook PC
        Version: Rev 1
        OS: Linux\Slamd64
        SMP Sun May 4 16:51:34 BST 2008 x86_64 x86_64 x86_64 GNU/Linux




# repo sync
 [   ....   ]
# make
build/core/product_config.mk:207: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
build/core/main.mk:180: implicitly installing apns-conf_sdk.xml
[ ... ]
host Executable: adb (out/host/linux-x86/obj/EXECUTABLES/
adb_intermediates/adb)
/usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../x86_64-slamd64-
linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-slamd64-
linux/4.2.3/../../../libncurses.so when searching for -lncurses
/usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../x86_64-slamd64-
linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-slamd64-
linux/4.2.3/../../../libncurses.a when searching for -lncurses
/usr/lib64/gcc/x86_64-slamd64-linux/4.2.3/../../../../x86_64-slamd64-
linux/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb]
Error 1

I have tried to download source of ncurses-5.7.tar.gz and copile it
over 6 times, with various configure parameter:

        ./configure                                     \
                --prefix=/usr                           \
                --sysconfdir=/etc                       \
                --localstatedir=/var                    \
                --libdir=/usr/lib64                     \
                --build=x86_64-linux-linux-gnu          \


        ./configure                                     \
                --prefix=/usr                           \
                --sysconfdir=/etc                       \
                --localstatedir=/var                    \
                --libdir=/usr/lib64                     \
                --build=x86_64-linux-linux-gnu          \
                --enable-broken_linker                  \
                --without-ada                           \



        ./configure                                     \
                --prefix=/usr                           \
                --sysconfdir=/etc                       \
                --localstatedir=/var                    \
                --libdir=/usr/lib64                     \
                --build=x86_64-linux-linux-gnu          \
                --enable-broken_linker                  \
                --without-ada                           \
                --without-normal                        \
                --without-debug                         \
                --with-shared                           \


        ./configure                                     \
                --prefix=/usr                           \
                --sysconfdir=/etc                       \
                --localstatedir=/var                    \
                --libdir=/usr/lib64                     \
                --build=x86_64-linux-linux-gnu          \
                --enable-broken_linker                  \
                --without-ada                           \
                --without-normal                        \
                --without-debug                         \
                --with-shared                           \
                --with-libtool                          \
                --with-build-cc                         \
                --with-build-libs                       \

[ ... ]

Anyone have this problem? Any solution for..? I try since 5 day...

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

2. Aligning title of a dialog to be in center

Hi,

I have a custom dialog box extending android.app.Dialog. I would like
make sure that its title is aligned to center. Can someone help me
figure out how to get that done?

Thanks
Inder

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

3. If your hosting your own .apk

4. How to catch global events?

5. Query about Content Provider queries

6. difference in android SDK version 0.9beta and 1.0

7. Content Provider for Drafts