Actually it doesn't work even for a new URL in the history (tried typing a
brand new page and then clicking a few links, still no logs).

The DATE can be 0 if the URL stands for a bookmark and not a history item.
If the DATE > 0, it is a history item and the number is millis since
1/1/1970.

The ASC is there so the latest history item is printed last into the logs
for faster debugging :)

Filip

2011/7/19 Daniel Drozdzewski <[email protected]>

> Yeah, this test would work only for new URL in the history.
> What you are doing is right, since you want to get the URL of
> currently rendered web page.
>
> I would change the following in your cursor:
>
> final String whereClause = Browser.BookmarkColumns.VISITS + " > 0";
>
> ... and don't do any conditions on DATE. Could the date be negative or
> zero? and if so, what does that mean? Regardless of the answer, you
> could be discarding valuable data, as you don't know, what is the
> right value of the DATE column. If it is milliseconds since 1.01.1970.
> then it will always be > 0. If it is some other convention and it
> could have negative values, then you are filtering potentially good
> data.
>
> Also
>
>  final String orderBy = Browser.BookmarkColumns.DATE + " DESC";
>
> ... so that the first row returned is the one you are looking for.
>
>
> Other than this, I can't think of anything else you have missed.
>
> Daniel
>
> --
> 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
>

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