On Mon, Apr 27, 2009 at 6:35 PM, 黃冠宇 <[email protected]> wrote:

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

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.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to