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. Bocoran OTA update Hero 2.1

kagak tau beneran apa kagak nih

http://forum.xda-developers.com/showthread.php?t=655720

katanya jangan OTA update, bakalan ngelocked bootloader jadinya kagak bisa
di root dah tuh hero...

Agak meyakinkan juga, eh apa April Mop yak??


-- 
-------------------------------
@acynx
acynx....@naekgenteng.com
ac...@ratjoendroid.com
---sent from pc

-- 
"Indonesian Android Community [id-android]" 

2. Langkah2 app2sd

Bros,

Bagaimana langkah2 untuk install applikasi di sd card?
Nexus 1 r00ted modaco 21, dengan amon RA 1.6.2

Apakah harus install ulang semua aplikasi yang sudah dilakukan sebelum app2sd?

Tia.

Thank You & Best Regards
Andreas
d'ILLUSION studios 
3D Animation & Visual Interactive

 

Sent from my BlackBerry Wireless Handheld from M1.

-- 
"Indonesian Android Community [id-android]" 

3. Apa Yang Perlu Dilakukan

4. (WTI) Game Evil Zenonia

5. How to generate "uImage" in stead of "zImage" when build Android kernel

6. Finally, I published my Android/GAE based MMO War Game

7. Regarding language change notification