import android.content.DialogInterface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.content.DialogInterface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
public class CreateHomeScreenShortcut extends DialogFragment {
// The public interface is used to send information back to the parent activity.
public interface CreateHomeScreenSchortcutListener {
public class CreateHomeScreenShortcut extends DialogFragment {
// The public interface is used to send information back to the parent activity.
public interface CreateHomeScreenSchortcutListener {
private CreateHomeScreenSchortcutListener createHomeScreenShortcutListener;
// Check to make sure that the parent activity implements the listener.
private CreateHomeScreenSchortcutListener createHomeScreenShortcutListener;
// Check to make sure that the parent activity implements the listener.
dialogBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialogBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// 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 the Dialog is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
// Show the keyboard when the Dialog is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);