1

I am developing an application which displays a user's broswer history.
I'm successfully displaying the page title and URL, but I'm allways getting the same date - regardless of when the site was last visited.

The date is always 28/10/2015/20:55

                TextView view = (TextView) findViewById(R.id.tv);


            String[] projection = new String[]{
                    Browser.BookmarkColumns.TITLE
                    , Browser.BookmarkColumns.URL
                    ,Browser.BookmarkColumns.DATE

            };

            Cursor mCur = managedQuery(android.provider.Browser.BOOKMARKS_URI,
                    projection, null, null, null
            );


            String date="";
            mCur.moveToFirst();
            int titleIdx = mCur.getColumnIndex(Browser.BookmarkColumns.TITLE);
            int urlIdx = mCur.getColumnIndex(Browser.BookmarkColumns.URL);

            date =  mCur.getString(mCur.getColumnIndex(Browser.BookmarkColumns.DATE));


            Long timestamp = Long.parseLong(date);
            SimpleDateFormat dateFormat = new SimpleDateFormat( "dd/MM/yyyy/HH:mm");
            Calendar calendar = Calendar.getInstance();
            calendar.setTimeInMillis(timestamp);
            String  finaldate = dateFormat.format(calendar.getTime());
            String smsDate = finaldate.toString();




            while (mCur.isAfterLast() == false) {


               view.append("Tite: " + mCur.getString(titleIdx)+"\n");
               view.append("Url: " + mCur.getString(urlIdx)+"\n");
                view.append("date: " + smsDate +"\n");
                view.append("\n");
                mCur.moveToNext();
            }

Any help would be greatly appreciated.

The Title & Url are outputting correctly, but not the date.
I've obviously done something wrong in getting the date, but I'm not sure what.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
RoRo88
  • 306
  • 1
  • 4
  • 14

0 Answers0