diff options
Diffstat (limited to 'src/com/android/browser/AddBookmarkPage.java')
| -rw-r--r-- | src/com/android/browser/AddBookmarkPage.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java index 2a92dce0c..7878762ad 100644 --- a/src/com/android/browser/AddBookmarkPage.java +++ b/src/com/android/browser/AddBookmarkPage.java @@ -21,6 +21,7 @@ import android.content.ContentResolver; import android.content.Intent; import android.content.res.Resources; import android.database.Cursor; +import android.graphics.Bitmap; import android.net.ParseException; import android.net.WebAddress; import android.os.Bundle; @@ -46,6 +47,8 @@ public class AddBookmarkPage extends Activity { private boolean mEditingExisting; private Bundle mMap; private String mTouchIconUrl; + private Bitmap mThumbnail; + private String mOriginalUrl; private View.OnClickListener mSaveBookmark = new View.OnClickListener() { public void onClick(View v) { @@ -81,8 +84,9 @@ public class AddBookmarkPage extends Activity { setTitle(R.string.edit_bookmark); } title = mMap.getString("title"); - url = mMap.getString("url"); + url = mOriginalUrl = mMap.getString("url"); mTouchIconUrl = mMap.getString("touch_icon_url"); + mThumbnail = (Bitmap) mMap.getParcelable("thumbnail"); } mTitle = (EditText) findViewById(R.id.title); @@ -154,7 +158,14 @@ public class AddBookmarkPage extends Activity { getIntent().toString()).putExtras(mMap)); } else { final ContentResolver cr = getContentResolver(); - Bookmarks.addBookmark(null, cr, url, title, true); + + // Only use mThumbnail if url and mOriginalUrl are matches. + // Otherwise the user edited the url and the thumbnail no longer applies. + if (mOriginalUrl.equals(url)) { + Bookmarks.addBookmark(null, cr, url, title, mThumbnail, true); + } else { + Bookmarks.addBookmark(null, cr, url, title, null, true); + } if (mTouchIconUrl != null) { final Cursor c = BrowserBookmarksAdapter.queryBookmarksForUrl( |
