import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
// Get the data from the arguments.
val currentFolder = requireArguments().getString(CURRENT_FOLDER)!!
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
// Get the data from the arguments.
val currentFolder = requireArguments().getString(CURRENT_FOLDER)!!
// Set the listener for the cancel button. Using `null` as the listener closes the dialog without doing anything else.
dialogBuilder.setNegativeButton(R.string.cancel, null)
// Set the listener for the cancel button. Using `null` as the listener closes the dialog without doing anything else.
dialogBuilder.setNegativeButton(R.string.cancel, null)
// Add the subfolder to except folders.
exceptFolders.append(",")
// Add the subfolder to except folders.
exceptFolders.append(",")
override fun bindView(view: View, context: Context, cursor: Cursor) {
// Get the data from the cursor.
override fun bindView(view: View, context: Context, cursor: Cursor) {
// Get the data from the cursor.
- val folderIconByteArray = cursor.getBlob(cursor.getColumnIndex(BookmarksDatabaseHelper.FAVORITE_ICON))
- val folderName = cursor.getString(cursor.getColumnIndex(BookmarksDatabaseHelper.BOOKMARK_NAME))
+ val folderIconByteArray = cursor.getBlob(cursor.getColumnIndexOrThrow(BookmarksDatabaseHelper.FAVORITE_ICON))
+ val folderName = cursor.getString(cursor.getColumnIndexOrThrow(BookmarksDatabaseHelper.BOOKMARK_NAME))
// Get handles for the views.
val folderIconImageView = view.findViewById<ImageView>(R.id.move_to_folder_icon)
// Get handles for the views.
val folderIconImageView = view.findViewById<ImageView>(R.id.move_to_folder_icon)