I make a program, with an imageView in the layout. I made a thread, I want run it. When it reach the 2000 millisecond I want to change the imageview on the screen. I tried to do it with the setImageDrawable(*) (where is the drawable name, but it write ** can’t be resolved). How I can do it?
Share
Try setImageResource(int resid) and use a resource Id like R.drawable.myDrawable. If you want to use setImageDrawable then you need to pass in a Drawable, not a drawable name.
Also, not sure, but you may have issues due to the fact that your thread is not the UI thread. So if you get rid of the error, and the image isn’t changing then try using AsycTask or Handler instead of a thread.