Drawable to imageView

Put your problem here if it does not fit any of the other categories.

Drawable to imageView

Postby rouxette » Thu May 15, 2008 1:48 pm

Hi,

I need some ImageView in order to move my penguin.
my code was :
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. eq = (Equipe) tabEquipe.get(i);
  2.  
  3. ((Drawable)eq.getPions().get(0).getImage()).setBounds(x,y,x+28,y+28);
  4.  
  5. ((Drawable)eq.getPions().get(0).getImage()).draw(canvas);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4

(-> it was working)

and i have changed that by :
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. ((ImageView)eq.getPions().get(0).getImage()).getDrawable().setBounds(x,y,x+28,y+28);
  2.  
  3. ((ImageView)eq.getPions().get(0).getImage()).draw(canvas);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


but i obtain : null pointer execption

Please, can you help me to transform my drawable into an ImageView. thx
rouxette
Once Poster
Once Poster
 
Posts: 1
Joined: Thu May 15, 2008 1:38 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 22 guests