首页 > 移动平台 > 详细

classcastexception:android.widget.listview

时间:2015-02-05 21:37:07      阅读:283      评论:0      收藏:0      [点我收藏+]

自定义了一个CallbackScrool 继承ListView

public CallbackScroll mMessagelist;
mMessagelist = (CallbackScroll) findViewById(R.id.messagelist);

报错:

classcastexception:android.widget.listview

分析结果:

<ListView
              android:id="@+id/messagelist"
              android:layout_height="match_parent" 
              android:scrollbarStyle="outsideOverlay"
              android:fillViewport="true"
              android:scrollbarSize="1dp"
              android:scrollbarThumbVertical="@drawable/bar"
              android:layout_width="match_parent"    >
</ListView>

更正后:

<com.activity.duoduo.CallbackScroll
              android:id="@+id/messagelist"
              android:layout_height="match_parent" 
              android:scrollbarStyle="outsideOverlay"
              android:fillViewport="true"
              android:scrollbarSize="1dp"
              android:scrollbarThumbVertical="@drawable/bar"
              android:layout_width="match_parent"    >
</com.activity.duoduo.CallbackScroll>

 

classcastexception:android.widget.listview

原文:http://www.cnblogs.com/duoyewu/p/4275886.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!