Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7498011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:18:07+00:00 2026-05-29T19:18:07+00:00

I currently have a SurfaceView that is in Landscape mode. Currently I am trying

  • 0

I currently have a SurfaceView that is in Landscape mode.

Currently I am trying to add on an Action Bar/Menu Bar using

/*Action Bar */
//this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);   **
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_menu, menu);

Is there any way to leave the Action Bar in portrait mode on the screen while the SurfaceView is Landscape?

I have tried adding

this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

but this makes the whole SurfaceView Portrait.

And then adding this

this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

at the end would inf loop the program

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:18:10+00:00Added an answer on May 29, 2026 at 7:18 pm

    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); or LANDSCAPE sets the orientation of the Activity, so you can’t use it for the Surface View. If you want the ActionBar to be in portrait mode then you need to set the activity in Portrait, but figure out another way to set the SurfaceView to Landscape.

    I would suggest for the SurfaceView to set the rotation of the Camera object, that way you will get the SurfaceView orientation in Landscape. Try the following:

    public void surfaceCreated(SurfaceHolder holder) {
        camera = Camera.open();
        camera.setDisplayOrientation(90);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON
I am currently drawing a Bitmap to a SurfaceView using Canvas.drawBitmap() . This seems
I currently have a SurfaceView (named BoardView) that is being stored in a FrameLayout.
I'm using a SurfaceView in Android. The application is always in landscape mode. In
I currently have links w/ class=ajax that I want to retrieve the element with
I currently have a UINavigationController based application that works just fine. I'd like to
I have a camera class that holds a picture of the camera using SurfaceHolder
I am trying to create a simple 3-D app for android that will have
Currently have this code defining getter/setter for an object's selectedID property. The object is
I currently have a tab bar application in the works, and have run into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.