I am developing one android application in which I am able to play all the videos and Images in SD card.But I am getting the blank screen for 2 or 3 seconds while displaying video after image. I don't want that blank screen, I need to show the video immediately after image. Can anyone tell how to do that?
Asked
Active
Viewed 119 times
0
-
put some code then only somebody can help – Shakeeb Ayaz Jul 23 '13 at 08:06
-
The blank screen might be because the execution of onCreate() function in your activity takes a long time. Re-check the code in your onCreate() and run it in a separate thread. – ShineDown Jul 23 '13 at 08:41
2 Answers
0
This seems to happen when you're loading image and video and try to navigate away from image to video before the image.This problem occur when image size and video size is large.so check image and video size.otherwise give permission in android manifest
android:largeHeap="true"

Dharmendra
- 571
- 5
- 12
0
Try playing video inside onPrepared()
, first of all just initialize the VideoView with its path or URI of the video and then play it,
mVideoView.setVideoURI(Uri.parse(path));
mVideoView.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mVideoView.start();
}
});

Lalit Poptani
- 67,150
- 23
- 161
- 242