¿Hay alguna forma de configurar una orientación inicial para el dispositivo Android?

Hi I want to set an initial orientation for the device to be portrait mode. but after the user starts playing with the app they can change the orientation.

all the examples i found are just the set to one oriention which cannot be later change.

Muchas Gracias

UPDATE: This is what i did to fix to get around this

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
super.loadUrl("file:///android_asset/www/index.html");     
OrientationThread orthread = new OrientationThread(this);
orthread.start();

class OrientationThread extends Thread {
    DroidGap droidGap;
    OrientationThread(DroidGap dGap) {
        droidGap = dGap;
    }

    public void run() {

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            //e.printStackTrace();
        }
        synchronized(droidGap){
            droidGap.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
        }

    }

preguntado el 01 de febrero de 12 a las 14:02

1 Respuestas

I think this is the method you're looking for:

setRequestedOrientation()

¡Espero que esto ayude!

Respondido 01 Feb 12, 18:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.