import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
import android.database.Cursor
import android.database.DatabaseUtils
import android.database.MatrixCursor
import android.database.Cursor
import android.database.DatabaseUtils
import android.database.MatrixCursor
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)!!
// Use an alert dialog builder to create the alert dialog.
val dialogBuilder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog)
// Use an alert dialog builder to create the alert dialog.
val dialogBuilder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog)
// Set the icon according to the theme.
dialogBuilder.setIconAttribute(R.attr.moveToFolderBlueIcon)
// Set the title.
dialogBuilder.setTitle(R.string.move_to_folder)
// Set the icon according to the theme.
dialogBuilder.setIconAttribute(R.attr.moveToFolderBlueIcon)
// Set the title.
dialogBuilder.setTitle(R.string.move_to_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)