Я получаю ClassCastException при отладке моего приложения.
obj = (CommonFeedBean) ResponseHandler_Review.vectorLocation1.elementAt(i);
Я получаю ClassCastException в приведенной выше строке. Полный код:
for(int i=0;i<ResponseHandler_Review.vectorLocation1.size();i++)
{
System.out.println("inside the for loop");
obj = (CommonFeedBean) ResponseHandler_Review.vectorLocation1.elementAt(i);
System.out.println("inside the obj++++++");
hr1 = new HorizontalFieldManager(){
protected void onFocus(int direction) {
invalidate();
super.onFocus(direction);
}
protected void onUnfocus() {
invalidate();
super.onUnfocus();
}
public void paint(Graphics graphics) {
if (isFocus()) {
graphics.setBackgroundColor(Color.WHITE);
graphics.clear();
}
super.paint(graphics);
}
};
String arg[] ;
System.out.println("vectorlocation size " + ResponseHandler_Review.vectorLocation1.size());
arg = new String[ResponseHandler_Review.vectorLocation1.size()];
System.out.println("after arg++++++++++");
bit = new Bitmap[ResponseHandler_Review.vectorLocation1.size()];
scaleBit = new Bitmap[ResponseHandler_Review.vectorLocation1.size()];
System.out.println("after bit array+++++++");
for(int j = 0; j< ResponseHandler_Review.vectorLocation1.size(); j++){
arg[j] = String.valueOf(ResponseHandler_Review.vectorLocation1.elementAt(j));
System.out.println("Vector element is "+j+" = "+arg[j]);
bit[j] = response.getImage(arg[j]);
scaleBit[j] = new Bitmap(162, 120);
bit[j].scaleInto(scaleBit[j], Bitmap.FILTER_LANCZOS);
hr1.add(new BitmapField(scaleBit[j]));
}
try{
label[i] = new LabelField(obj.getTitle(), Field.FIELD_VCENTER|Field.FOCUSABLE)
{
public int getPreferredWidth()
{
return Display.getWidth()-150;
}
protected boolean navigationClick(int status, int time) {
fieldChangeNotify(0);
return true;
}
};