TheAppFoundry 11 Posted July 10, 2017 My script is lagging very bad. The onPaint is being called rapidly as I assume is normal. I'm just trying to draw a rectangle but it lags very badly. I put the main thread to sleep in the onstart to see if there was anything interfering and it still lags. Any ideas? @Override public void onPaint(Graphics graphics) { log("OnPaint Called"); graphics.drawRect(100,100,200,200); graphics.setColor(Color.CYAN); log("test after rect"); } @Override public void onStart() { try { Thread.sleep(10000); } catch (InterruptedException e) { e.printStackTrace(); } log("On Start Called");
Pandemic 2853 Posted July 10, 2017 I wouldn't log anything in onPaint, and we recommend you use our sleep method instead of Thread.sleep()
distraction 61 Posted July 10, 2017 I had this same problem when I was working on my first paint. The problem was exactly what pandemic mentioned, the logs in the paint function.
TheAppFoundry 11 Author Posted July 11, 2017 @pandemic, why y'alls threads over the normal java ones? If you don't mind me asking!I also didn't think logs were that intensive?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.