0

Estoy desarrollando con apache cordova y necesito crear un boton que me permita acceder a la app de la Galeria. Con android studio lo hacia con el siguiente bloque de codigo


@Override
            public void onClick(View view) {
                Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("content://media/internal/images/media"));
                startActivity(intent);
            }

Hay una forma de hacerlo con Apache Cordova, existe algún simil?

1 respuesta 1

0

Investigando he encontrado el plugin

com-darryncampbell-cordova-plugin-intent

instalando con cordova y añadiendo

window.plugins.intentShim.startActivityForResult(
            {
                action: window.plugins.intentShim.ACTION_PICK,
                url: "content://com.android.contacts/contacts",
                requestCode: 1
            },
            function(intent)
            {
                if (intent.extras.requestCode == 1)
                {
                    alert('Picked contact: ' + intent.data);
                }
            },
            function()
            {
                alert("StartActivityForResult failure");
            });

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.