1

- I have two activities, suppose Activity A and Activity B.

- My aim here is to have a function that will record a video and save it. Then once its done, we play it and printing at Logcat that its playing.

- We are using VideoView to play the video, and isPlaying() method to get the confirmation that its playing.

- Now in Activity A we are able to get true for isPlaying() but we get false for the same in Activity B. Even if we can see the video play, still we get false for isPlaying() while the video is very much playing.

The code that works in Activity A but not in Activity B:

final Dialog nagDialog = new Dialog(RMMGuessMime.this,android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);

        View vx = View.inflate(RMMGuessMime.this,R.layout.pop_video,null);
        nagDialog.setContentView(vx);
        nagDialog.setCancelable(true);

        final VideoView vVideo = (VideoView)vx.findViewById(R.id.vv);
        vVideo.setVideoPath(videoUri.getPath());




            Thread audioPlay = new Thread(new Runnable() {

                @Override
                public void run() {


                    vVideo.start();
                    System.out.println("Vv started :"+vVideo.isPlaying());


                    while(vVideo.isPlaying()){

                        //------------------------------ Here i want my Sysout or Log to be printed as true...but instead i am getting false...

                    }
                }
            });

            audioPlay.start();

I have done and tried everything possible to set this right but its not working....... please help me out...

RINK
  • 620
  • 5
  • 15

0 Answers0