import android.content.DialogInterface;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
// If we don't use `android.support.v7.app.AlertDialog` instead of `android.app.AlertDialog` then the dialog will be covered by the keyboard.
import android.content.DialogInterface;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
// If we don't use `android.support.v7.app.AlertDialog` instead of `android.app.AlertDialog` then the dialog will be covered by the keyboard.
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageView;
// The public interface is used to send information back to the parent activity.
public interface EditBookmarkListener {
// The public interface is used to send information back to the parent activity.
public interface EditBookmarkListener {
}
// `editBookmarkListener` is used in `onAttach()` and `onCreateDialog()`
private EditBookmarkListener editBookmarkListener;
}
// `editBookmarkListener` is used in `onAttach()` and `onCreateDialog()`
private EditBookmarkListener editBookmarkListener;
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Get a long array with the the databaseId of the selected bookmark and convert it to an `int`.
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Get a long array with the the databaseId of the selected bookmark and convert it to an `int`.
int selectedBookmarkDatabaseId = (int) selectedBookmarkLongArray[0];
// Get a `Cursor` with the specified bookmark and move it to the first position.
int selectedBookmarkDatabaseId = (int) selectedBookmarkLongArray[0];
// Get a `Cursor` with the specified bookmark and move it to the first position.
// Create an `AlertDialog` from the `AlertDialog.Builder`.
final AlertDialog alertDialog = dialogBuilder.create();
// Create an `AlertDialog` from the `AlertDialog.Builder`.
final AlertDialog alertDialog = dialogBuilder.create();
// Show the keyboard when `alertDialog` is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
// Show the keyboard when `alertDialog` is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);