- // We need to show the `AlertDialog` before we can call `setOnKeyListener()` below.
- editBookmarkDialog.show();
+ // Get the current favorite icon byte array from the `Cursor`.
+ byte[] currentIconByteArray = bookmarkCursor.getBlob(bookmarkCursor.getColumnIndex(BookmarksDatabaseHandler.FAVORITE_ICON));
+ // Convert the byte array to a `Bitmap` beginning at the first byte and ending at the last.
+ Bitmap currentIconBitmap = BitmapFactory.decodeByteArray(currentIconByteArray, 0, currentIconByteArray.length);
+ // Display `currentIconBitmap` in `edit_bookmark_current_icon`.
+ ImageView currentIconImageView = (ImageView) alertDialog.findViewById(R.id.edit_bookmark_current_icon);
+ assert currentIconImageView != null; // Remove the warning below that `currentIconImageView` might be null;
+ currentIconImageView.setImageBitmap(currentIconBitmap);