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

  • SEARCH
  • Home
  • 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 8304113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:44:38+00:00 2026-06-08T17:44:38+00:00

i got this surficeview <SurfaceViewandroid:id=@+id/videoviewandroid:layout_width=720pxandroid:layout_height=480px/> how can i manage that set the size automaticly

  • 0

i got this surficeview

<SurfaceViewandroid:id="@+id/videoview"android:layout_width="720px"android:layout_height="480px"/>

how can i manage that set the size automaticly to display size?
Because every android phone has another display size?

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-06-08T17:44:42+00:00Added an answer on June 8, 2026 at 5:44 pm

    you’ll have to catch it in onSurfaceCreated() and try to resize it there…

      private class surfaceCallback implements SurfaceHolder.Callback
    {
        @Override
        public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
        {
            if (holder == videoHolder)
            {
                Log.e(TAG, "video surfaceChanged: f: " + format + ", w: " + width + ", h: " + height);
    
                //resize it here maybe?
            } else
            {
                Log.e(TAG, "Unknown surface: f: " + format + ", w: " + width + ", h: " + height);
                assert (false);
            }
        }
    
        @Override
        public void surfaceCreated(SurfaceHolder holder)
        {
            Log.e(TAG, "surfaceCreated");
        }
    
        @Override
        public void surfaceDestroyed(SurfaceHolder holder)
        {
            Log.e(TAG, "surfaceDestroyed");
        }
    }
    

    one possible way to get your display size…

        //measured android resolution
        WindowManager win = (WindowManager) getApplicationContext().getSystemService(WINDOW_SERVICE);
        Display d = win.getDefaultDisplay();
        Point measuredResolution = new Point();
        d.getSize(measuredResolution); //measuredResolution now holds actual size.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got this site with UN/PW set via the Createuserwizard control. Client considers PW too
Got this error on a big $_GET query in size ~9 000 symbols (they
Got this regex string from JavaScript: the good parts (pp. 66). Can't get it
got this code from a website that helped me in creating buttons and stuff.
I got this example from one StackOverflow question that was asked but I couldn't
Got this really stupid problem: Can find the proper name for the android folder
I got this flash application where you can click a link while watching a
I got this error when I tried to compile an application that includes the
I got this query that is not working, and I don't know what it
Got this code, that only works when alert (markers.length); is uncommented. When this javascript

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.