1
public class view extends View
{
public view(Context context)
{
super(context);
}
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawBitmap(thing1, 200, 200, null);
run();
}
public void run()
{
try {
Thread.sleep(2000);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
if(tester2){
thing1=BitmapFactory.decodeResource(getResources(), R.drawable.image2);
tester2=false;
invalidate();
}
else
{
thing1=BitmapFactory.decodeResource(getResources(), R.drawable.image1);
tester2=true;
invalidate();
}
}
}
这工作正常,但我得到“应用程序可能做了太多工作”的消息在日志中,并跳过一堆帧。我该如何解决?跳过#帧...应用程序可能在其主线程上做了太多工作。
[该应用程序可能在其主线程上做了太多工作](http://stackoverflow.com/questions/14678593/the-application-may-be-doing-too-much-work-on - 它的-主线程) – settaratici