HoloEverywhere搜索栏ClassCastException异常 [英] HoloEverywhere SeekBar ClassCastException

查看:232
本文介绍了HoloEverywhere搜索栏ClassCastException异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我利用HoloEverywhere提供的搜索栏类。我有以下的进口:

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;

我没有得到任何preliminary错误或警告,但是当我编译,我得到以下行一类转换异常:

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);

下面是相应的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?

推荐答案

更改为:

<org.holoeverywhere.widget.SeekBar
        android:id="@+id/sectionTimeElapsedSeekBar"
        ...
        />

这篇关于HoloEverywhere搜索栏ClassCastException异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆