public class EditBookmarkFolder extends DialogFragment {
// The public interface is used to send information back to the parent activity.
public interface EditBookmarkFolderListener {
- void onCancelEditBookmarkFolder(DialogFragment dialogFragment);
-
void onSaveEditBookmarkFolder(DialogFragment dialogFragment);
}
dialogBuilder.setNegativeButton(R.string.cancel, new Dialog.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- // Return the `DialogFragment` to the parent activity on cancel.
- editBookmarkFolderListener.onCancelEditBookmarkFolder(EditBookmarkFolder.this);
+ // Do nothing. The `AlertDialog` will close automatically.
}
});
currentIconImageView.setImageBitmap(currentIconBitmap);
// Get a `Bitmap` of the favorite icon from `MainWebViewActivity` and display it in `edit_folder_web_page_favorite_icon`.
- ImageView webPageFavoriteIcon = (ImageView) alertDialog.findViewById(R.id.edit_folder_web_page_favorite_icon);
- assert webPageFavoriteIcon != null; // Remove the warning below that `webPageFavoriteIcon` might be null.
- webPageFavoriteIcon.setImageBitmap(MainWebViewActivity.favoriteIcon);
+ ImageView webPageFavoriteIconImageView = (ImageView) alertDialog.findViewById(R.id.edit_folder_web_page_favorite_icon);
+ assert webPageFavoriteIconImageView != null; // Remove the warning below that `webPageFavoriteIcon` might be null.
+ webPageFavoriteIconImageView.setImageBitmap(MainWebViewActivity.favoriteIcon);
// Load the text for `edit_folder_name_edittext`.
EditText folderNameEditText = (EditText) alertDialog.findViewById(R.id.edit_folder_name_edittext);