Search in sources :

Example 21 with AlertDialog

use of android.support.v7.app.AlertDialog in project quickstart-android by firebase.

the class MainActivity method askFavoriteFood.

/**
     * Display a dialog prompting the user to pick a favorite food from a list, then record
     * the answer.
     */
private void askFavoriteFood() {
    final String[] choices = getResources().getStringArray(R.array.food_items);
    AlertDialog ad = new AlertDialog.Builder(this).setCancelable(false).setTitle(R.string.food_dialog_title).setItems(choices, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            String food = choices[which];
            setUserFavoriteFood(food);
        }
    }).create();
    ad.show();
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) DialogInterface(android.content.DialogInterface)

Example 22 with AlertDialog

use of android.support.v7.app.AlertDialog in project WordPress-Android by wordpress-mobile.

the class EditorFragment method onMediaTapped.

public void onMediaTapped(final String mediaId, final MediaType mediaType, final JSONObject meta, String uploadStatus) {
    if (mediaType == null || !isAdded()) {
        return;
    }
    switch(uploadStatus) {
        case "uploading":
            // Display 'cancel upload' dialog
            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            builder.setTitle(getString(R.string.stop_upload_dialog_title));
            builder.setPositiveButton(R.string.stop_upload_button, new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int id) {
                    mEditorFragmentListener.onMediaUploadCancelClicked(mediaId, true);
                    mWebView.post(new Runnable() {

                        @Override
                        public void run() {
                            switch(mediaType) {
                                case IMAGE:
                                    mWebView.execJavaScriptFromString("ZSSEditor.removeImage(" + mediaId + ");");
                                    break;
                                case VIDEO:
                                    mWebView.execJavaScriptFromString("ZSSEditor.removeVideo(" + mediaId + ");");
                            }
                            mUploadingMedia.remove(mediaId);
                        }
                    });
                    dialog.dismiss();
                }
            });
            builder.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int id) {
                    dialog.dismiss();
                }
            });
            AlertDialog dialog = builder.create();
            dialog.show();
            break;
        case "failed":
            // Retry media upload
            mEditorFragmentListener.onMediaRetryClicked(mediaId);
            mWebView.post(new Runnable() {

                @Override
                public void run() {
                    switch(mediaType) {
                        case IMAGE:
                            mWebView.execJavaScriptFromString("ZSSEditor.unmarkImageUploadFailed(" + mediaId + ");");
                            break;
                        case VIDEO:
                            mWebView.execJavaScriptFromString("ZSSEditor.unmarkVideoUploadFailed(" + mediaId + ");");
                    }
                    mFailedMediaIds.remove(mediaId);
                    mUploadingMedia.put(mediaId, mediaType);
                }
            });
            break;
        default:
            if (!mediaType.equals(MediaType.IMAGE)) {
                return;
            }
            // Only show image options fragment for image taps
            FragmentManager fragmentManager = getFragmentManager();
            if (fragmentManager.findFragmentByTag(ImageSettingsDialogFragment.IMAGE_SETTINGS_DIALOG_TAG) != null) {
                return;
            }
            mEditorFragmentListener.onTrackableEvent(TrackableEvent.IMAGE_EDITED);
            ImageSettingsDialogFragment imageSettingsDialogFragment = new ImageSettingsDialogFragment();
            imageSettingsDialogFragment.setTargetFragment(this, ImageSettingsDialogFragment.IMAGE_SETTINGS_DIALOG_REQUEST_CODE);
            Bundle dialogBundle = new Bundle();
            dialogBundle.putString("maxWidth", mBlogSettingMaxImageWidth);
            dialogBundle.putBoolean("featuredImageSupported", mFeaturedImageSupported);
            // Request and add an authorization header for HTTPS images
            // Use https:// when requesting the auth header, in case the image is incorrectly using http://.
            // If an auth header is returned, force https:// for the actual HTTP request.
            HashMap<String, String> headerMap = new HashMap<>();
            if (mCustomHttpHeaders != null) {
                headerMap.putAll(mCustomHttpHeaders);
            }
            try {
                final String imageSrc = meta.getString("src");
                String authHeader = mEditorFragmentListener.onAuthHeaderRequested(UrlUtils.makeHttps(imageSrc));
                if (authHeader.length() > 0) {
                    meta.put("src", UrlUtils.makeHttps(imageSrc));
                    headerMap.put("Authorization", authHeader);
                }
            } catch (JSONException e) {
                AppLog.e(T.EDITOR, "Could not retrieve image url from JSON metadata");
            }
            dialogBundle.putSerializable("headerMap", headerMap);
            dialogBundle.putString("imageMeta", meta.toString());
            String imageId = JSONUtils.getString(meta, "attachment_id");
            if (!imageId.isEmpty()) {
                dialogBundle.putBoolean("isFeatured", mFeaturedImageId == Integer.parseInt(imageId));
            }
            imageSettingsDialogFragment.setArguments(dialogBundle);
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
            fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
            fragmentTransaction.add(android.R.id.content, imageSettingsDialogFragment, ImageSettingsDialogFragment.IMAGE_SETTINGS_DIALOG_TAG).addToBackStack(null).commit();
            mWebView.notifyVisibilityChanged(false);
            break;
    }
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) DialogInterface(android.content.DialogInterface) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) Bundle(android.os.Bundle) JSONException(org.json.JSONException) SpannableString(android.text.SpannableString) SuppressLint(android.annotation.SuppressLint) FragmentManager(android.app.FragmentManager) OnClickListener(android.content.DialogInterface.OnClickListener) FragmentTransaction(android.app.FragmentTransaction)

Example 23 with AlertDialog

use of android.support.v7.app.AlertDialog in project PhotoNoter by yydcdut.

the class PermissionAspect method requestPermissions.

private static void requestPermissions(@NonNull final Activity activity, String explanation, final String[] permissions, final int code) {
    boolean shouldShowRationale = false;
    for (String permission : permissions) {
        if (ActivityCompat.shouldShowRequestPermissionRationale(activity, permission)) {
            shouldShowRationale = true;
            break;
        }
    }
    if (shouldShowRationale) {
        //explanation
        AlertDialog dialog = new AlertDialog.Builder(activity, R.style.note_dialog).setTitle(R.string.permission_title).setMessage(explanation).setCancelable(false).setPositiveButton(R.string.dialog_btn_ok, (dialogCallback, which) -> ActivityCompat.requestPermissions(activity, permissions, code)).setNegativeButton(R.string.dialog_btn_cancel, null).create();
        dialog.show();
    } else {
        ActivityCompat.requestPermissions(activity, permissions, code);
    }
}
Also used : AlertDialog(android.support.v7.app.AlertDialog)

Example 24 with AlertDialog

use of android.support.v7.app.AlertDialog in project AdMoney by ErnestoGonAr.

the class Detalle_Categorias method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detalle__categorias);
    bd = new BDHandlerAM(this);
    a = bd.spinneregresos();
    bandera = false;
    modificar = (TextView) findViewById(R.id.modificar);
    eliminar = (TextView) findViewById(R.id.eliminar);
    quitaricono = (TextView) findViewById(R.id.quitaricono);
    cambiaricono = (TextView) findViewById(R.id.cambiaricono);
    final ItemC item = (ItemC) getIntent().getSerializableExtra("item");
    itemaux = item;
    modificar.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            AlertDialog.Builder mBuilder = new AlertDialog.Builder(Detalle_Categorias.this);
            View mView = getLayoutInflater().inflate(R.layout.categorias_selected, null);
            final EditText mtexto = (EditText) mView.findViewById(R.id.modificarb);
            final Button mguardar = (Button) mView.findViewById(R.id.modificarguardar);
            final Button mcancelar = (Button) mView.findViewById(R.id.modificarcancelar);
            mtexto.setText(itemaux.nombre);
            mtexto.requestFocus();
            InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
            mBuilder.setView(mView);
            AlertDialog dialog = mBuilder.create();
            dialog.show();
            mguardar.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    validartexto = mtexto.getText().toString();
                    updatear(itemaux.nombre);
                    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                    imm.hideSoftInputFromWindow(mtexto.getWindowToken(), 0);
                    if (bandera) {
                        bd.updateCategoriasE(primeroMayuscula(mtexto.getText().toString()), itemaux.nombre);
                    }
                    onBackPressed();
                }
            });
            mcancelar.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    onBackPressed();
                }
            });
        // ///////////////////////////////////////////////////////////
        }
    });
    eliminar.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            new AlertDialog.Builder(Detalle_Categorias.this).setTitle("Eliminar Categoria").setMessage("Seguro que quieres eliminar categoria").setPositiveButton("Si", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    Log.d("AlertDialog", "Positive");
                    if (item.nombre.equals("Prestamos")) {
                        msjprestamos();
                        onBackPressed();
                    } else {
                        bd.eliminarCE(item.nombre);
                        onBackPressed();
                    }
                }
            }).setNegativeButton("No", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    Log.d("AlertDialog", "Negative");
                    onBackPressed();
                }
            }).show();
        }
    });
    quitaricono.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            new AlertDialog.Builder(Detalle_Categorias.this).setTitle("Eliminar Icono").setMessage("Seguro que quieres quitar icono?").setPositiveButton("Si", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    Log.d("AlertDialog", "Positive");
                    bd.quitarIconoe(item.id);
                    msjiconoquitado();
                    onBackPressed();
                }
            }).setNegativeButton("No", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    Log.d("AlertDialog", "Negative");
                    onBackPressed();
                }
            }).show();
        }
    });
    cambiaricono.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            AlertDialog.Builder mBuilder = new AlertDialog.Builder(Detalle_Categorias.this);
            View mView = getLayoutInflater().inflate(R.layout.categoriase_elegir, null);
            ImageButton cae1 = (ImageButton) mView.findViewById(R.id.cae1);
            ImageButton cae2 = (ImageButton) mView.findViewById(R.id.cae2);
            ImageButton cae3 = (ImageButton) mView.findViewById(R.id.cae3);
            ImageButton cae4 = (ImageButton) mView.findViewById(R.id.cae4);
            ImageButton cae5 = (ImageButton) mView.findViewById(R.id.cae5);
            ImageButton cae6 = (ImageButton) mView.findViewById(R.id.cae6);
            ImageButton cae7 = (ImageButton) mView.findViewById(R.id.cae7);
            ImageButton cae8 = (ImageButton) mView.findViewById(R.id.cae8);
            ImageButton cae9 = (ImageButton) mView.findViewById(R.id.cae9);
            ImageButton cae10 = (ImageButton) mView.findViewById(R.id.cae10);
            ImageButton cae11 = (ImageButton) mView.findViewById(R.id.cae11);
            ImageButton cae12 = (ImageButton) mView.findViewById(R.id.cae12);
            ImageButton cae13 = (ImageButton) mView.findViewById(R.id.cae13);
            ImageButton cae14 = (ImageButton) mView.findViewById(R.id.cae14);
            ImageButton cae16 = (ImageButton) mView.findViewById(R.id.cae16);
            ImageButton cae17 = (ImageButton) mView.findViewById(R.id.cae17);
            ImageButton cae18 = (ImageButton) mView.findViewById(R.id.cae18);
            ImageButton cae19 = (ImageButton) mView.findViewById(R.id.cae19);
            ImageButton cae20 = (ImageButton) mView.findViewById(R.id.cae20);
            ImageButton cae21 = (ImageButton) mView.findViewById(R.id.cae21);
            ImageButton caenuevo1 = (ImageButton) mView.findViewById(R.id.caenuevo1);
            ImageButton caenuevo2 = (ImageButton) mView.findViewById(R.id.caenuevo2);
            ImageButton caenuevo3 = (ImageButton) mView.findViewById(R.id.caenuevo3);
            ImageButton caenuevo4 = (ImageButton) mView.findViewById(R.id.caenuevo4);
            ImageButton caenuevo5 = (ImageButton) mView.findViewById(R.id.caenuevo5);
            ImageButton caenuevo6 = (ImageButton) mView.findViewById(R.id.caenuevo6);
            mBuilder.setView(mView);
            AlertDialog dialog = mBuilder.create();
            dialog.show();
            cae1.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 1);
                    onBackPressed();
                }
            });
            cae2.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 2);
                    onBackPressed();
                }
            });
            cae3.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 3);
                    onBackPressed();
                }
            });
            cae4.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 4);
                    onBackPressed();
                }
            });
            cae5.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 5);
                    onBackPressed();
                }
            });
            cae6.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 6);
                    onBackPressed();
                }
            });
            cae7.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 7);
                    onBackPressed();
                }
            });
            cae8.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 8);
                    onBackPressed();
                }
            });
            cae9.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 9);
                    onBackPressed();
                }
            });
            cae10.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 10);
                    onBackPressed();
                }
            });
            cae11.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 11);
                    onBackPressed();
                }
            });
            cae12.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 12);
                    onBackPressed();
                }
            });
            cae13.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 13);
                    onBackPressed();
                }
            });
            cae14.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 14);
                    onBackPressed();
                }
            });
            cae16.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 16);
                    onBackPressed();
                }
            });
            cae17.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 17);
                    onBackPressed();
                }
            });
            cae18.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 18);
                    onBackPressed();
                }
            });
            cae19.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 19);
                    onBackPressed();
                }
            });
            cae20.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 20);
                    onBackPressed();
                }
            });
            cae21.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 21);
                    onBackPressed();
                }
            });
            caenuevo1.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 22);
                    onBackPressed();
                }
            });
            caenuevo2.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 23);
                    onBackPressed();
                }
            });
            caenuevo3.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 24);
                    onBackPressed();
                }
            });
            caenuevo4.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 25);
                    onBackPressed();
                }
            });
            caenuevo5.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 26);
                    onBackPressed();
                }
            });
            caenuevo6.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoe(itemaux.id, 27);
                    onBackPressed();
                }
            });
        }
    });
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) EditText(android.widget.EditText) DialogInterface(android.content.DialogInterface) ItemC(layout.ItemC) InputMethodManager(android.view.inputmethod.InputMethodManager) TextView(android.widget.TextView) View(android.view.View) ImageButton(android.widget.ImageButton) ImageButton(android.widget.ImageButton) Button(android.widget.Button)

Example 25 with AlertDialog

use of android.support.v7.app.AlertDialog in project AdMoney by ErnestoGonAr.

the class Detalle_CategoriasIngreso method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detalle_categoriasingreso);
    bd = new BDHandlerAM(this);
    a = bd.spinneringresos();
    bandera = false;
    modificar = (TextView) findViewById(R.id.modificari);
    eliminar = (TextView) findViewById(R.id.eliminari);
    quitaricono = (TextView) findViewById(R.id.quitariconoi);
    cambiaricono = (TextView) findViewById(R.id.cambiariconoi);
    final ItemC item = (ItemC) getIntent().getSerializableExtra("item");
    itemaux = item;
    modificar.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            AlertDialog.Builder mBuilder = new AlertDialog.Builder(Detalle_CategoriasIngreso.this);
            View mView = getLayoutInflater().inflate(R.layout.categoriasi_selected, null);
            final EditText mtexto = (EditText) mView.findViewById(R.id.modificarbi);
            final Button mguardar = (Button) mView.findViewById(R.id.modificarguardari);
            final Button mcancelar = (Button) mView.findViewById(R.id.modificarcancelari);
            mtexto.setText(itemaux.nombre);
            mtexto.requestFocus();
            InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
            mBuilder.setView(mView);
            AlertDialog dialog = mBuilder.create();
            dialog.show();
            mguardar.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    validartexto = mtexto.getText().toString();
                    updatear(itemaux.nombre);
                    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                    imm.hideSoftInputFromWindow(mtexto.getWindowToken(), 0);
                    if (bandera) {
                        bd.updateCategoriasI(primeroMayuscula(mtexto.getText().toString()), itemaux.nombre);
                    }
                    onBackPressed();
                }
            });
            mcancelar.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    onBackPressed();
                }
            });
        // ///////////////////////////////////////////////////////////
        }
    });
    eliminar.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            new AlertDialog.Builder(Detalle_CategoriasIngreso.this).setTitle("Eliminar Categoria").setMessage("Seguro que quieres eliminar categoria").setPositiveButton("Si", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    Log.d("AlertDialog", "Positive");
                    if (item.nombre.equals("Deudas")) {
                        msjprestamos();
                        onBackPressed();
                    } else {
                        bd.eliminarCI(item.nombre);
                        onBackPressed();
                    }
                }
            }).setNegativeButton("No", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    Log.d("AlertDialog", "Negative");
                    onBackPressed();
                }
            }).show();
        }
    });
    quitaricono.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            new AlertDialog.Builder(Detalle_CategoriasIngreso.this).setTitle("Eliminar Icono").setMessage("Seguro que quieres quitar icono?").setPositiveButton("Si", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    Log.d("AlertDialog", "Positive");
                    bd.quitarIconoi(item.id);
                    msjiconoquitado();
                    onBackPressed();
                }
            }).setNegativeButton("No", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    Log.d("AlertDialog", "Negative");
                    onBackPressed();
                }
            }).show();
        }
    });
    cambiaricono.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            AlertDialog.Builder mBuilder = new AlertDialog.Builder(Detalle_CategoriasIngreso.this);
            View mView = getLayoutInflater().inflate(R.layout.categoriasi_elegir, null);
            ImageButton cai1 = (ImageButton) mView.findViewById(R.id.cai1);
            ImageButton cai2 = (ImageButton) mView.findViewById(R.id.cai2);
            ImageButton cai3 = (ImageButton) mView.findViewById(R.id.cai3);
            ImageButton cai4 = (ImageButton) mView.findViewById(R.id.cai4);
            ImageButton cai5 = (ImageButton) mView.findViewById(R.id.cai5);
            ImageButton cai6 = (ImageButton) mView.findViewById(R.id.cai6);
            ImageButton cai8 = (ImageButton) mView.findViewById(R.id.cai8);
            ImageButton cai9 = (ImageButton) mView.findViewById(R.id.cai9);
            ImageButton cai10 = (ImageButton) mView.findViewById(R.id.cai10);
            ImageButton cai11 = (ImageButton) mView.findViewById(R.id.cai11);
            ImageButton cai12 = (ImageButton) mView.findViewById(R.id.cai12);
            ImageButton cai13 = (ImageButton) mView.findViewById(R.id.cai13);
            ImageButton cai14 = (ImageButton) mView.findViewById(R.id.cai14);
            ImageButton cai15 = (ImageButton) mView.findViewById(R.id.cai15);
            ImageButton cai16 = (ImageButton) mView.findViewById(R.id.cai16);
            ImageButton cai17 = (ImageButton) mView.findViewById(R.id.cai17);
            ImageButton cai18 = (ImageButton) mView.findViewById(R.id.cai18);
            ImageButton cai19 = (ImageButton) mView.findViewById(R.id.cai19);
            ImageButton cai20 = (ImageButton) mView.findViewById(R.id.cai20);
            ImageButton cai21 = (ImageButton) mView.findViewById(R.id.cai21);
            ImageButton cainuevo1 = (ImageButton) mView.findViewById(R.id.cainuevo1);
            ImageButton cainuevo2 = (ImageButton) mView.findViewById(R.id.cainuevo2);
            ImageButton cainuevo3 = (ImageButton) mView.findViewById(R.id.cainuevo3);
            ImageButton cainuevo4 = (ImageButton) mView.findViewById(R.id.cainuevo4);
            ImageButton cainuevo5 = (ImageButton) mView.findViewById(R.id.cainuevo5);
            ImageButton cainuevo6 = (ImageButton) mView.findViewById(R.id.cainuevo6);
            mBuilder.setView(mView);
            AlertDialog dialog = mBuilder.create();
            dialog.show();
            cai1.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 1);
                    onBackPressed();
                }
            });
            cai2.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 2);
                    onBackPressed();
                }
            });
            cai3.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 3);
                    onBackPressed();
                }
            });
            cai4.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 4);
                    onBackPressed();
                }
            });
            cai5.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 5);
                    onBackPressed();
                }
            });
            cai6.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 6);
                    onBackPressed();
                }
            });
            cai8.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 8);
                    onBackPressed();
                }
            });
            cai9.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 9);
                    onBackPressed();
                }
            });
            cai10.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 10);
                    onBackPressed();
                }
            });
            cai11.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 11);
                    onBackPressed();
                }
            });
            cai12.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 12);
                    onBackPressed();
                }
            });
            cai13.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 13);
                    onBackPressed();
                }
            });
            cai14.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 14);
                    onBackPressed();
                }
            });
            cai15.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 15);
                    onBackPressed();
                }
            });
            cai16.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 16);
                    onBackPressed();
                }
            });
            cai17.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 17);
                    onBackPressed();
                }
            });
            cai18.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 18);
                    onBackPressed();
                }
            });
            cai19.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 19);
                    onBackPressed();
                }
            });
            cai20.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 20);
                    onBackPressed();
                }
            });
            cai21.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 21);
                    onBackPressed();
                }
            });
            cainuevo1.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 22);
                    onBackPressed();
                }
            });
            cainuevo2.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 23);
                    onBackPressed();
                }
            });
            cainuevo3.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 24);
                    onBackPressed();
                }
            });
            cainuevo4.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 25);
                    onBackPressed();
                }
            });
            cainuevo5.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 26);
                    onBackPressed();
                }
            });
            cainuevo6.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    bd.cambiarIconoi(itemaux.id, 27);
                    onBackPressed();
                }
            });
        }
    });
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) EditText(android.widget.EditText) DialogInterface(android.content.DialogInterface) ItemC(layout.ItemC) InputMethodManager(android.view.inputmethod.InputMethodManager) TextView(android.widget.TextView) View(android.view.View) ImageButton(android.widget.ImageButton) ImageButton(android.widget.ImageButton) Button(android.widget.Button)

Aggregations

AlertDialog (android.support.v7.app.AlertDialog)413 DialogInterface (android.content.DialogInterface)275 View (android.view.View)219 TextView (android.widget.TextView)165 Intent (android.content.Intent)117 EditText (android.widget.EditText)87 ImageView (android.widget.ImageView)68 Button (android.widget.Button)67 LayoutInflater (android.view.LayoutInflater)59 RecyclerView (android.support.v7.widget.RecyclerView)54 NonNull (android.support.annotation.NonNull)53 AdapterView (android.widget.AdapterView)51 SuppressLint (android.annotation.SuppressLint)50 ArrayList (java.util.ArrayList)48 Bundle (android.os.Bundle)46 ListView (android.widget.ListView)42 Context (android.content.Context)35 SharedPreferences (android.content.SharedPreferences)35 Uri (android.net.Uri)32 LinearLayout (android.widget.LinearLayout)29