android.widget.Button cannot be cast to android.widget.Gallery
2014-03-19 22:47
441 查看
Gallery g = (Gallery)findViewById(R.id.secondButton); 因为这句运行报错,放鼠标在这上面时显示
@Deprecated
This class was deprecated in API level 16.
This widget is no longer supported. Other horizontally scrolling widgets include
删除Gallery g = (Gallery)findViewById(R.id.secondButton);就可以了
用这种表示 secondButton = (Button)findViewById(R.id.secondButton);
求大神求解
@Deprecated
This class was deprecated in API level 16.
This widget is no longer supported. Other horizontally scrolling widgets include
HorizontalScrollViewand
ViewPagerfrom the support library.
删除Gallery g = (Gallery)findViewById(R.id.secondButton);就可以了
用这种表示 secondButton = (Button)findViewById(R.id.secondButton);
求大神求解
相关文章推荐
- java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.wid
- java.lang.ClassCastException~android.widget.ImageView cannot be cast to android.widget.Button~
- 关于Android.widget.Button cannot be cast to com.esri.android.map.MapView错误的问题
- 解决方法 android.view.AbsSavedState$1 cannot be cast to android.widget.CompoundButton$SavedState
- 安卓出现android.widget.TextView cannot be cast to android.widget.Button问题
- 【Android】程序崩溃错误为Android.widget,textView cannot be cast to android.widget.button
- 解决android.view.AbsSavedState$1 cannot be cast to android.widget.CompoundButton$SavedState
- 错误android.widget.ImageButton cannot be cast to android.widget.Button
- widget.Button cannot be cast to android.widget.ListView
- ClassCastException: android.widget.Button cannot be cast to android.view.Vi
- 【Android】程序崩溃错误为Android.widget,textView cannot be cast to android.widget.button
- APP程序崩溃错误为Android.widget,textView cannot be cast to android.widget.button
- 关于java.lang.ClassCastException: android.widget.Button cannot be cast to android.widget.Edit 错误的解决
- android.widget.FrameLayout$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams
- java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.w
- android.view.ViewGroup$LayoutParams cannot be cast to android.widget.TableRow$LayoutParams
- .ClassCastException: .LinearLayout cannot be cast to android.widget.TextView
- java.lang.ClassCastException: android.widget.ImageView cannot be cast to android.widget.TextView解决办法
- android.view.ViewGroup$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams