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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:05:25+00:00 2026-05-30T05:05:25+00:00

I have my main Activity, it starts with a custom SurfaceView called DrawView being

  • 0

I have my main Activity, it starts with a custom SurfaceView called DrawView being set by setContentView. The Main Activity (Draw) has the following method within it

public void launchCutScene(int scene) {     
    Intent intent = new Intent(Draw.this, CutScene.class);
    startActivityForResult(intent, 0);  
}

if I call this method directly after setContentView the new Activity CutScene loads properly. CutScene is as follows

public class CutScene extends Activity implements OnCompletionListener, OnPreparedListener{
String pathToFile = "";
VideoView videoPlayer;

@Override
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        pathToFile = "EM Math/" + "st.mp4";

        setContentView(R.layout.main);   
        File root = Environment.getExternalStorageDirectory();
        videoPlayer = (VideoView) findViewById(R.id.myvideoview);  
        videoPlayer.setOnPreparedListener(this);
        videoPlayer.setOnCompletionListener(this);
        videoPlayer.setKeepScreenOn(true);    
        videoPlayer.setVideoPath(root + "/" + pathToFile);  
    }

    @Override
    protected void onDestroy() {
    super.onDestroy();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    public void onPrepared(MediaPlayer vp) {             
       videoPlayer.start();
    }

    @Override
    public void onCompletion(MediaPlayer  mp) {
       finish();
    }

    @Override
    public boolean onTouchEvent (MotionEvent ev){   
       if(ev.getAction() == MotionEvent.ACTION_DOWN){
          if(videoPlayer.isPlaying()){
            videoPlayer.pause();
          } else {
                   videoPlayer.start();
          }
          return true;      
       } else {
          return false;
       }
    }
}

However, if within DrawView I call draw.launchCutScene(0) then the activity still comes up, but the video glitches, it either stays as a black screen and you have to press back to make the activity crash, in which case it will bring up the first activity. Or it will play the sound only but multiple times and un-synced. Either way after it crashes if a launchCutScene call is done again within the DrawView class the video now works fine.

Why is this happening? does anybody understand what I need to do?

  • 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-30T05:05:26+00:00Added an answer on May 30, 2026 at 5:05 am

    Okay, Finely fixed the error!

    All I had to do was set my threads runnable boolean to false, then call the activity. Once activity closes my program reinitiates the thread, and everything work hunkydorry now!!!!… So if your getting this Video Bug with your Video Views it’s probably because you are running a thread in the background!

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

Sidebar

Related Questions

I have main table called 'Employee' and another slave table called 'EmployeeTypes' that has
I have a main activity and a sub activity. The main activity starts the
I have a Activity called main. If I call Toast.makeText(this, Hello World from main,
My application starts from an Main activity and this main activity has its own
So, I have written an app that has a Main activity (A), and various
This has been killing me for two days now. I have a main Activity
This has been killing me for two days now. I have a main Activity
I have some main activity and clicking on a button it launches a custom
In my main activity, I would like to have it set up, so that
I have 2 activities - Say Activity A and B. My main activity(A) has

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.