O'Reilly Forums: Head First Android Development - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Head First Android Development Error in Code

#1 User is offline   Hitesh Dhanwani 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 11-May 12

Posted 11 May 2012 - 09:47 AM

Errors:

1st : The method onCreate(Bundle) is undefined for the type DefaultHandler


2nd: Cannot cast from TextView to ImageView
0

#2 User is offline   Git15 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 26-June 12

Posted 26 June 2012 - 09:50 AM

I was trying the code for NASA(image of the day) RSS feed given in the book, but as i tried getting a reference to the image as follows;

ImageView imageView=(ImageView)findViewById(R.id.imageDisplay);
imageView.setImageBitmap(image);

I am getting following error;
"Cannot cast from TextView to ImageView".
What can be the cause for this error?
0

#3 User is offline   Brasz 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 09-July 12

Posted 09 July 2012 - 06:38 AM

View PostGit15, on 26 June 2012 - 09:50 AM, said:

I am getting following error;
"Cannot cast from TextView to ImageView".
What can be the cause for this error?

You probably declared imageDisplay as a TextView instead of an ImageView in your xml file.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users