This is how I start the query in my viewing activity.

mRoutes = managedQuery(getIntent().getData(), ROUTE_PROJECTION, null,
null);

This is some of the provider code.

public Cursor query(Uri url, String[] projection, String selection,
    String[] selectionArgs, String sort)
    ...
    Cursor c = qb.query(mDB, projection, selection, selectionArgs,
null, null, orderBy);
    c.setNotificationUri(getContext().getContentResolver(), url);
    return c;
}

public Uri insert(Uri url, ContentValues initialValues) {
    ...
    rowID = mDB.insert("climbingroutes", OnBelay.ClimbingRoute.NAME,
values);
    if (rowID > 0) {
        Uri uri =
ContentUris.withAppendedId(OnBelay.ClimbingRoute.CONTENT_URI, rowID);
        getContext().getContentResolver().notifyChange(uri, null);
        return uri;
    }
    ...
}

public int update(Uri url, ContentValues values, String where,
String[] whereArgs) {
    ....
    getContext().getContentResolver().notifyChange(url, null);
}

public int delete(Uri url, String where, String[] whereArgs) {
    ....
    getContext().getContentResolver().notifyChange(url, null);
    return count;
}

On Apr 21, 5:44 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>  Hi,
>
>  If you call Activity's startManagingCursor() method, it should
> automatically take care of the cursor based on Activity's lifecycle. You can
> look at the NotePad tutorial for example. You could also provide your
> relevant code here to help us debug it further?
>
>  Thanks,
>  Megha
>
> On Mon, Apr 21, 2008 at 2:25 PM, Flik <[EMAIL PROTECTED]> wrote:
>
> > What can cause an activity to stop managing a cursor or a
> > managedCursor to not update onReststart or a managed cursor to not be
> > notified of an update? I seem to having this problem when I change
> > activities with startActivity or startSubActivity.
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to