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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:50:51+00:00 2026-06-03T18:50:51+00:00

I am working on streaming a song from the web. I have made the

  • 0

I am working on streaming a song from the web. I have made the Customized Seek Bar, but I’m unable to set a secondary progress bar in my application. I have attached my code. Please let me know where I may have made a mistake.

This is my custom_seek_bar.xml:

<?xml version="1.0" encoding="UTF-8"?>

<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item
    android:id="@android:id/background">
    <shape>
        <corners
            android:radius="10dip" />
        <stroke
            android:width="4dip"
            android:color="#ff000000" />
        <gradient
            android:startColor="#ff734B35"
            android:centerColor="#ff8A6249"
            android:centerY="0.50"
            android:endColor="#ff91694F"
            android:angle="270" />
    </shape>
</item>
<item
    android:id="@android:id/secondaryProgress">
    <clip>
        <shape>
            <corners
                android:radius="10dip" />
            <stroke
            android:width="4dip"
            android:color="#ff000000" />
            <gradient
                android:startColor="#ff734B35"
                android:centerColor="#ff8A6249"
                android:endColor="#ff91694F"
                android:angle="270" />
        </shape>
    </clip>
</item>
<item
    android:id="@android:id/progress">
    <clip>
        <shape>
            <corners
                android:radius="10dip" />
            <stroke
            android:width="4dip"
            android:color="#ff000000" />
            <gradient
                android:startColor="#432011"
                android:endColor="#ff4A2514"
                android:angle="90" />
        </shape>
    </clip>
</item>

This is my styles.xml:

 <style name="CustomSeekBar" parent="android:Widget.SeekBar">
      <item name="android:progressDrawable">@drawable/custom_seek_bar</item>
       <item name="android:thumbOffset">0dip</item>
</style>

I have declared it in playing.xml:

 <SeekBar
            android:id="@+id/seekBar1"
            style="@style/CustomSeekBar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="17dp"
            android:layout_marginRight="15dp"
            android:secondaryProgress="100"
            android:thumb="@drawable/point" />

This is my java file:

SeekBar songControl, songControl1;
songControl = (SeekBar) view.findViewById(R.id.seekBar1);
songControl.setEnabled(false);
txt_Timer = (TextView) view.findViewById(R.id.text_start_time);
txt_stop_timer = (TextView) view.findViewById(R.id.text_stop_time);
songControl.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) {
            // TODO Auto-generated method stub

            Log.d("Progres changed", "" + progress);

            try {

                if (mediaPlayer.isPlaying()) {
                    int seconds = (int) (progress / 1000) % 60;
                    int minutes = (int) ((progress / (1000 * 60)));
                    txt_Timer.setText("" + minutes + ":" + seconds);
                    if (fromUser) {
                        mediaPlayer.seekTo(progress);
                        songControl.setProgress(progress);

                    }
                } else
                    songControl.setProgress(progress);

            } catch (Exception e) {
                // TODO: handle exception
                e.printStackTrace();
            }

        }
    });
 @Override
public void onBufferingUpdate(MediaPlayer mp, int percent) {
    // TODO Auto-generated method stub
    Log.i("Main Activity", "Progress" + percent);

    songControl.setSecondaryProgress(percent);
    songControl.setBackgroundColor(Color.BLUE);
}

After all this I get no errors, but while playing the song I don’t get the secondary progress bar in SeekBar. I suspect the problem might be in Custom_seek_bar.xml, but can’t see what I’m doing wrong.

  • 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-03T18:50:52+00:00Added an answer on June 3, 2026 at 6:50 pm

    There is no error in your xml. You didn’t see the secondary progress bar just because the color of the secondary progress is same as background. So change your background or secondary progress color to get what you want!

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

Sidebar

Related Questions

I am working on streaming a video from web. Where I decode the video/audio
I'm streaming the mic audio between two devices, everything is working but i have
I'm working on a streaming project. I have VLC running as a server, streaming
OK. AvPlayer is working great with streaming audio. In my app I have UISlider
While working on decoding some video streaming standards I have noticed a lot of
I'm trying to set up a web server that will support streaming video to
Currently I am working on audio streaming on android. All method I have written
Last few days I am working hard on RTSP streaming directly on iPhone but
I am working on android application in which i have play online radio streaming.
I am working in iPhone SDK.I have to convert from it to Crossplatform which

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.