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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:58:50+00:00 2026-06-06T23:58:50+00:00

Wrote an application for GoogleTV box to play a video. The video is a

  • 0

Wrote an application for GoogleTV box to play a video. The video is a separate activity to the main activity.
Wired up a button on my main layout/activity to to start the video activity up (using its own video.xml layout), the video activity loads and starts playing, but the video is clipped, only showing a few centimetres of the bottom. The clipped region looks like the views that occupied the previous layout (main.xml) . The intriguing thing is that if I push the back button, before returning to the main activity the full video frame is shown.
Not sure what I am doing wrong here. Any suggestions welcome.

Code:
main.xml

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

    <TextView
        android:id="@+id/hello_message"
        android:layout_width="fill_parent"
        android:layout_height="200dp"
        android:gravity="center"
        android:text="@string/hello_message"
        android:textSize="78sp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <EditText
            android:id="@+id/edit_message"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ems="10"
            android:hint="@string/edit_message" >

            <requestFocus />
        </EditText>

        <Button
            android:id="@+id/button_send"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="displayMessage"
            android:text="@string/button_send" />
        <Button
            android:id="@+id/button_send_a"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="sendMesssage"
            android:text="@string/button_send_a" />

    </LinearLayout>

    <Button
        android:id="@+id/videobutton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="startAVideo"
        android:text="Video Player" />

</LinearLayout>

GoogleTVExActivity.java (excerpt):

...
public class GoogleTVExActivity extends Activity {

     public final static String EXTRA_MESSAGE = "uk.co.bbc.googletvex.MESSAGE";

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    public void displayMessage(View view)
    {
        TextView t = (TextView)findViewById(R.id.hello_message); 
        EditText e =(EditText) findViewById(R.id.edit_message);
        t.setText(e.getText().toString());
        e.setText("");
    }

    public void sendMesssage(View view)
    {
        Intent intent = new Intent(this, DisplayMessageActivity.class);
        EditText editText = (EditText) findViewById(R.id.edit_message);
        String message = editText.getText().toString();
        intent.putExtra(EXTRA_MESSAGE, message);
        startActivity(intent);
    }

    public void startAVideo(View view)
    {
        Intent intent = new Intent(this, VideoViewActivity.class);
        startActivity(intent);
    }
}

video.xml:

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

    <VideoView
   android:id="@+id/myvideoview"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent" />

</LinearLayout>

VideoViewActivity.java (excerpt)

...

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class VideoViewActivity extends Activity {

    String SrcPath = "rtsp://v5.cache1.c.youtube.com/CjYLENy73wIaLQnhycnrJQ8qmRMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoYPj_hYjnq6uUTQw=/0/0/0/video.3gp";

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.video);
           VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview);
           myVideoView.setVideoURI(Uri.parse(SrcPath));
           myVideoView.setMediaController(new MediaController(this));
           myVideoView.requestFocus();
           myVideoView.start();
    }

}
  • 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-06T23:58:52+00:00Added an answer on June 6, 2026 at 11:58 pm

    Make sure that the VideoViewActivity is fullscreen ie.
    Add the following to the and/or of the AndroidManifest.xml

    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    

    If the video is not fullscreen after that or has some blank area it might be because the video’s aspect ratio is different from your Google TV screen aspect ratio. Android will scale the video to fit the VideoView but it wont stretch it higher while keeping the width the same. You can try to re-make the videos and force them into a more standard 1080p or 720p aspect ratio.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote an application server (using python & twisted) and I want to start
I wrote an application using ASP.NET MVC, in this application I have an Index
I wrote little WPF application with 2 threads - main thread is GUI thread
I wrote an application, its not a social networking script by any means, but
I have .NET 3.5 application wrote in C# using NHibernate. Before I has OracleClientDriver
I wrote an application using the Android 2.2 SDK (API level 8). It is
I wrote an application using wxWidgets that uses wxList . I am having some
I wrote an application for Windows 7 using C# and VS2008 and it runs
I wrote simple application that using the cell phone camera. When i trying to
I wrote an application that runs some threads using ExecutorService and waits until they

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.