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 8167319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:09:22+00:00 2026-06-06T20:09:22+00:00

i have a videoview in my application. the code is like this. <?xml version=1.0

  • 0

i have a videoview in my application. the code is like this.

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/opsbuds"
    android:orientation="vertical">

    <TextView
        android:id="@+id/adtxt1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView"></TextView>

    <VideoView
        android:id="@+id/videoView11"
        android:layout_width="300dip"
        android:layout_height="250dip"
        android:layout_marginLeft="30dip"></VideoView>

    <LinearLayout
        android:id="@+id/llv11"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"></LinearLayout>

    <Button
        android:id="@+id/button1211"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:layout_marginTop="10dp"
        android:background="@drawable/button"
        android:text=" Continue "
        android:textColor="#800080"
        android:textSize="20dp"
        android:textStyle="bold"></Button>
</LinearLayout>
</ScrollView>

the video view width and hieght is mentioned in xml file. What i want is , once i press a button the videoview should come on full screen and once i press back button the videoview should go back to its mentioned size. please help?

  • 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-06T20:09:23+00:00Added an answer on June 6, 2026 at 8:09 pm

    Set full screen this way,

    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);
    android.widget.LinearLayout.LayoutParams params = (android.widget.LinearLayout.LayoutParams) videoView.getLayoutParams();
    params.width = metrics.widthPixels;
    params.height = metrics.heightPixels;
    params.leftMargin = 0;
    videoView.setLayoutParams(params);
    

    And back to original size, this way.

    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);
    android.widget.LinearLayout.LayoutParams params = (android.widget.LinearLayout.LayoutParams) videoView.getLayoutParams();
    params.width = (int)(300*metrics.density);
    params.height = (int)(250*metrics.density);
    params.leftMargin = 30;
    videoView.setLayoutParams(params);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two questions. I create movie player. This is my code: VideoView videoView
I have written this code to try and stream a video to my Android
I have an applications that I've built to target SDK 3.0. In this application
In my application, I have an activity play http live streaming video in landscape
I have this code : @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String
I have an android application that pulls a list of videos stored in an
I am having a VideoView in my application. I have set blur flags in
I have a VideoView that is inside a scrollView. When I scroll the scrollView,
I have the following code in my activity. In my xml, the video view
I have an application that plays video files. I have been using code for

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.