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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:41:44+00:00 2026-05-26T11:41:44+00:00

I am developing an application which plays videos from a playlist. In case there

  • 0

I am developing an application which plays videos from a playlist. In case there is no video on the device the app dowloads it from a site and moves to the next video in the list.

It works fine on the emulator, but on the real device there is an error when the mediaplayer method “onCompletion” is called:

09-22 11:50:54.553: ERROR/AndroidRuntime(4529): FATAL EXCEPTION: main
09-22 11:50:54.553: ERROR/AndroidRuntime(4529): java.lang.NullPointerException
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at android.widget.VideoView$3.onCompletion(VideoView.java:347)
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1304)
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at android.os.Looper.loop(Looper.java:123)
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at android.app.ActivityThread.main(ActivityThread.java:4627)
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at java.lang.reflect.Method.invokeNative(Native Method)
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at java.lang.reflect.Method.invoke(Method.java:521)
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-22 11:50:54.553: ERROR/AndroidRuntime(4529):     at dalvik.system.NativeStart.main(Native Method)

So the app runs and plays the 1st video, then crashes.
PS the device is dreambook w7

Can anyone help please?

here is the code:

public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    getWindow().setFormat(PixelFormat.TRANSLUCENT);
    setContentView(R.layout.main);
    FLcurrentVideo = 0;

    LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
    locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000L, 0, this);
    boolean isGPS = locationManager.isProviderEnabled (LocationManager.GPS_PROVIDER);
    if (isGPS == false) startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);

    //
    //Downloading Play List here
    //



  File clip=new File(Environment.getExternalStorageDirectory(),
            playList[FLcurrentVideo].substring(2, playList[FLcurrentVideo].length()-1)+".mp4");     

            if (FLReady[FLcurrentVideo]==1) {
                video=(VideoView)findViewById(R.id.video);
                video.setVideoPath(clip.getAbsolutePath());
                video.requestFocus();
                video.start();
            }
            else {
                if (FLReady[FLcurrentVideo] == 0) {
                    new CheckOutVideos(false).execute(FLcurrentVideo);
                }
            }



    video.setOnCompletionListener(new OnCompletionListener() {
      public void onCompletion(MediaPlayer player) {
          if (FLstoppedVideo==1) {          
              FLstoppedVideo=2;
          }
          else if (FLstoppedVideo==2) {     
              FLstoppedVideo = 0;
              File clip=new File(Environment.getExternalStorageDirectory(),
                    playList[stoppedVideoMarker].substring(2, playList[stoppedVideoMarker].length()-1)+".mp4");
                    video=(VideoView)findViewById(R.id.video);
                    video.setVideoPath(clip.getAbsolutePath());
                    video.requestFocus();
                    video.start();
                    video.seekTo(stoppedVideoTime);
                    video.resume();
          }
          else if (FLstoppedVideo==0) {     
              isGPSplaying = false;

          int FL = 1;
          while (FL == 1) {
          if (FLcurrentVideo<count-1) FLcurrentVideo++;
          else FLcurrentVideo = 0;
          File clip=new File(Environment.getExternalStorageDirectory(),
                    playList[FLcurrentVideo].substring(2, playList[FLcurrentVideo].length()-1)+".mp4");

                    if (FLReady[FLcurrentVideo]==1) {
                        FL=0;
                        video=(VideoView)findViewById(R.id.video);
                        video.setVideoPath(clip.getAbsolutePath());
                        video.requestFocus();
                        video.start();

                    }
                    else {
                        FL = 1;
                        if (FLReady[FLcurrentVideo] == 0) {
                        new CheckOutVideos(false).execute(FLcurrentVideo);
                        }
                    }
          }
          }
      }
  });

End the same problem: resizing video works fine on the emulator, but on the real device video size didn’t changes, but text and image views displays at the “right” position, above video, wich didn’t resized. Here is main.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:layout_width="fill_parent">
  <VideoView 
    android:id="@+id/video" 
    android:layout_width="600dip" android:layout_height="match_parent">
</VideoView>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_width="180dip">



<TextView  
        android:id="@+id/clock"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:text="time"
    >
</TextView>
<TextView  
        android:id="@+id/location"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:text="time"
    >
</TextView>
<ImageView 
    android:id="@+id/image1"
    android:layout_height="match_parent" android:layout_width="match_parent">
</ImageView>


</LinearLayout>

Thank you in advance.

SentineL

  • 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-26T11:41:45+00:00Added an answer on May 26, 2026 at 11:41 am

    If this helps someone:

    It seems, there is a some kind of bug on android 2.2 for VideoView class. The only way i foud to do something – is to do nothing. I throw away VideoView and done all what I nedded useing MediaPlayer class.

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

Sidebar

Related Questions

I am developing an iPhone application which plays the video using MPMoviePlayerController . When
i am developing application which send and receive data between two computers but there
I am developing an application which uses Bluetooth to connect to a device and
I am developing an application in which I need to extract the audio from
I am developing an application in which I used VideoView to play a video.
I am developing an application which loads video while the application launches. I observe
I am developing an iPhone application in which I play videos using MPMoviePlayerController .
I am developing an application which is based on user challenges. The app also
I am developing an application which uses both video recording and photo shoting.So i
I am developing an application which is similar to native contact book app of

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.