I have created one play button using ButtonField on blackberry screen, if I click on the button , I am able to play my audio files.
My requirement is to create volume control seek bar (if we drag the seek bar we should be able to increase or decrease the volume) and play/pause button on blackberry screen (the play/pause button should be placed beside the seek bar)
Here is my code:
HorizontalFieldManager hfmSecond = new HorizontalFieldManager();
slider = new SliderField(
Bitmap.getBitmapResource( "slider_thumb_normal.png" ),
Bitmap.getBitmapResource( "slider_progress_normal.png" ),
Bitmap.getBitmapResource( "slider_base_normal.png" ),
Bitmap.getBitmapResource( "slider_thumb_focused.png" ),
Bitmap.getBitmapResource( "slider_progress_focused.png" ),
Bitmap.getBitmapResource( "slider_base_focused.png"),
Bitmap.getBitmapResource( "slider_thumb_pressed.png" ),
Bitmap.getBitmapResource( "slider_progress_pressed.png" ),
Bitmap.getBitmapResource( "slider_base_pressed.png"),
50, 0, 10, 10, FOCUSABLE );
slider.setPadding( 5, 5, 5, 35 );
slider.setBackground( BackgroundFactory.createSolidBackground( 0xD3D3D3 ) );
hfmSecond.add(slider);
hfmSecond.add(_startPlayingButton);
add(hfmSecond);
If I use above code, I am able to display one slide bar on my screen.
I am not able to display the button and also, I want to display the slide bar at the bottom of the screen with play/pause button?
For adding the button at bottom of your screen use
the above code will add playbutton then the slider and after that there would be a pause button and all of that are at bottom of the screen. I think your slider taking all the width so you are unable to see the button you have added in you
HorizontalFieldManagerso reduce the width of the slider will work for you.