2

I am using the SeekBar class provided by HoloEverywhere. I have the following imports:

import org.holoeverywhere.widget.SeekBar;
import org.holoeverywhere.widget.SeekBar.OnSeekBarChangeListener;

I get no preliminary errors or warnings, but when I compile, I get a class cast exception on the following line:

sectionTimeElapsedSeekBar = (SeekBar) findViewById(R.id.sectionTimeElapsedSeekBar);

Here is the corresponding XML:

<SeekBar
        android:id="@+id/sectionTimeElapsedSeekBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/startOrPauseTimerButton"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="16dp"
        android:max="2100" />

Anyone have any ideas?

John Roberts
  • 5,885
  • 21
  • 70
  • 124

3 Answers3

4

Change to:

<org.holoeverywhere.widget.SeekBar
        android:id="@+id/sectionTimeElapsedSeekBar"
        ...
        />
dokkaebi
  • 9,004
  • 3
  • 42
  • 60
1

Extend activity from org.holoeverywhere.app.Activity.

Prototik
  • 935
  • 4
  • 7
0

try importing:

import android.widget.SeekBar;

instead of

import org.holoeverywhere.widget.SeekBar;
KhalidTaha
  • 453
  • 1
  • 5
  • 11