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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:37:07+00:00 2026-06-04T14:37:07+00:00

my source code is the app to introduction the video which can rotate when

  • 0

my source code is the app to introduction the video which can rotate when we rotate thier device. because i have to clip one portrait one landscape. But i dont know to auto implement the onConfigurationChange when user choose my app.
Can you help me the problem ?

 package nahu.jl.intro;

import android.app.Activity;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.MediaController;
import android.widget.Toast;
import android.widget.VideoView;

public class Nahu_videoIntroActivity extends Activity {
    /** Called when the activity is first created. */
    VideoView videoHolder;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        getWindow().setFormat(PixelFormat.TRANSLUCENT);
        videoHolder = (VideoView) findViewById(R.id.myvideoview);
        // set controller for video
        String sdCard=Environment.getExternalStorageDirectory().getPath();
        videoHolder.setMediaController(new MediaController(this));
        Toast.makeText(Nahu_videoIntroActivity.this, sdCard, Toast.LENGTH_SHORT).show();
        // get path to video from 

//      // start video

    }
    /* (non-Javadoc)
     * @see android.app.Activity#onConfigurationChanged(android.content.res.Configuration)
     */
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        // TODO Auto-generated method stub
        super.onConfigurationChanged(newConfig);
        if(newConfig.orientation==Configuration.ORIENTATION_PORTRAIT){
            Uri videoUri = Uri.parse("android.resource://nahu.jl.intro/raw/intro2");
            // set url to Video
            videoHolder.setVideoURI(videoUri);
             videoHolder.requestFocus();
            // start video
            videoHolder.start();

        }
        else{
            Uri videoUri = Uri.parse("android.resource://nahu.jl.intro/raw/intro1");
            // set url to Video
            videoHolder.setVideoURI(videoUri);
             videoHolder.requestFocus();
            // start video
            videoHolder.start();

        }
    }
    //
    public void onCompletion(MediaPlayer mp) {
        finish();

    }


}
  • 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-04T14:37:08+00:00Added an answer on June 4, 2026 at 2:37 pm

    use this in your activity tag in manifest file

     <activity android:name=".VideoActivity" android:label="" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:screenOrientation="sensor" android:configChanges="orientation"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C++ app called ./blah (to which I have the source code)
I have an app that I need to get the source code to update
I wrote an android app for someone, but they want the source code because
My app links to a third party static library which without source code and
I have the following crash log and complete source code of app. All I
Can I download source code of already deployed app if I've lost it's source
Can I download my App Engine source code from Google?
Can I get the complete source code of android market app, as it is
I have an app in my iPhone. Now i want to get source code
I have downloaded the Source code of Android 2.2 . Where can I find

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.