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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:26:49+00:00 2026-06-15T06:26:49+00:00

This is a sample code of the app i am developing . This is

  • 0

This is a sample code of the app i am developing .

This is my class file . . . .

public void onCreate(Bundle icicle) 
   {
     super.onCreate(icicle);
     setContentView(R.layout.main);

     sb = (SeekBar)findViewById(R.id.control_seekbar);

     mVideoView1 = (VideoView) findViewById(R.id.surface_view1);
     mVideoView1.setVideoPath("android.resource://" + getPackageName() +"/"+R.raw.play);              
     mVideoView1.pause();

     mVideoView2 = (VideoView) findViewById(R.id.surface_view2);
     mVideoView2.setVideoPath("android.resource://" + getPackageName() +"/"+R.raw.play);              
     mVideoView2.pause();

     v1 = mVideoView1.getDuration();
     v2 = mVideoView2.getDuration();

     mVideoView1.setOnPreparedListener(new OnPreparedListener() 
     {
        @Override
        public void onPrepared(MediaPlayer arg0) 
        {
            sb.setMax(mVideoView1.getDuration());
            sb.postDelayed(onEverySecond, 60);
        }
     });



     sb.setOnSeekBarChangeListener(new OnSeekBarChangeListener() 
     {  
        @Override
        public void onStopTrackingTouch(SeekBar seekBar) 
        {
            // TODO Auto-generated method stub

        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) 
        {
            // TODO Auto-generated method stub

        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) 
        {
            mVideoView1.seekTo(progress);
            mVideoView2.seekTo(progress);
        }
    });

   }

   private Runnable onEverySecond=new Runnable() 
   {
        @Override
        public void run() {

            if(sb != null) {
                sb.setProgress(mVideoView1.getCurrentPosition());
            }

            if(mVideoView1.isPlaying()) 
            {
                sb.postDelayed(onEverySecond, 1000);
            }

        }
    };

And this is my xml file . . . .

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">

   <LinearLayout 
       android:id="@+id/video_ll"
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:layout_above="@+id/control_btn_ll"
       android:orientation="horizontal">

        <VideoView
            android:id="@+id/surface_view1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:overScrollMode="always"/>

        <VideoView
            android:id="@+id/surface_view2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:overScrollMode="always"/>

   </LinearLayout>

   <LinearLayout 
       android:id="@+id/control_btn_ll"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_centerHorizontal="true"
       android:layout_alignParentBottom="true">

       <SeekBar
           android:id="@+id/control_seekbar"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:max="100"
           android:minHeight="1dp"
           android:minWidth="250dp" />

   </LinearLayout>

</RelativeLayout>

I have two videos and have to be updated simultaneously , while dragging the seekbar .
The videos should be in pause and i want the vedioView to update to the frame , i drag in the seekbar .

It works fine when the video is playing but not updating when it is in pause .

Thank-you in Advance .

  • 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-06-15T06:26:55+00:00Added an answer on June 15, 2026 at 6:26 am

    Androids videos dont update the frame after a seek if paused. You have to let the video(s) play for some milliseconds and then pause again. Thats the only way it works afaik.

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

Sidebar

Related Questions

Given this sample code: #include <iostream> #include <stdexcept> class my_exception_t : std::exception { public:
I have this sample code for async operations (copied from the interwebs) public class
In facebook tutorials I see this sample code: @Override public void onActivityResult(int requestCode, int
In this sample code the URL of the app seems to be determined by
I recently started developing a small app using the sample provided in this article.
I have tried developing a sample app with the help of the code from
i have tried developing a sample app with the help of the code from
A friend show me this sample code to implement HTTP POST in C# and
I have this sample code: DirectoryEntry _entry = new DirectoryEntry( connectionString, this.userPrinicipalName, this.password, AuthenticationTypes.SecureSocketsLayer
Say I have this sample code I'm writing for a Python lesson I'm holding:

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.