Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Videoview giving isPlaying() false
    primarykey
    data
    text
    <p><strong>-</strong> I have two activities, suppose Activity A and Activity B.</p> <p><strong>-</strong> 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 <code>Logcat</code> that its playing.</p> <p><strong>-</strong> We are using <code>VideoView</code> to play the video, and <code>isPlaying()</code> method to get the confirmation that its playing.</p> <p><strong>-</strong> Now in Activity A we are able to get <strong>true</strong> for isPlaying() but we get <strong>false</strong> for the same in Activity B. Even if we can see the video play, still we get <strong>false</strong> for <code>isPlaying()</code> while the video is very much playing.</p> <p><strong>The code that works in Activity A but not in Activity B:</strong></p> <pre><code>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(); </code></pre> <p>I have done and tried everything possible to set this right but its not working....... please help me out...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload