Exception message says it clearly:
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
You cannot access UI elements from separate thread. Remove
setImageResource(R.drawable.play)
from run()
.
If there's a little code (inside Activity class) that needs to be run on UI thread, you can use this method in Activity:
runOnUiThread(new Runnable(){
@override
public void run(){
//-- put code here--
}
});