user669593
user669593

Reputation: 5

Retaining view orientation

I have an actoivity that implements the methods of SurfaceHolder and to work with camera. In the main layout, which is a LinearLayout, I inserted another LinearLayout to act as an overlay and I setted the orientation to Landscape.

View overlayView = inflater.inflate(R.layout.cameraoverlay, null);
    this.addContentView(overlayView,
            new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));

    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

Because of this, the overlay, obviously, rotates too. And this is the problem. In the case of a dynamic view, how can I maintain the previously orientation of the overlay view?

Thanks for replies

Upvotes: 0

Views: 614

Answers (1)

Franco
Franco

Reputation: 7475

set the activity orientation to landscape in the android manifest.

<activity android:name=".activity.NewSearchBrowserActivity" android:theme="@style/Theme.FullScreen" android:screenOrientation="landscape"></activity>

this override any later orientation on the activity and it´s inner views.

Upvotes: 1

Related Questions