I'm building a simple Android game which does not require frame-rate speed. Think of it as a simple chess game.
I have created a custom view, where I draw the whole game using onDraw():
public class GameView extends View {
public GameView (Context context, AttributeSet attrs) {
super(context, attrs);
...
}
protected void onDraw(Canvas canvas) {
...
}
}
Currently in prototyping stage, I'm just drawing lines, circles, and rectangles, but not any bitmaps.
I'm drawing each time a player makes a move using invalidate()
(just 1 frame per player move).
The problem is that when the view is already drawn, I notice a frame-rate drop in the user interface, when for example I'm displaying a dialog or a toast to the user. It's happening when the view is already drawn, not the moment I'm drawing.
That's strange, isn't it? Since the view is already drawn, why do I notice this kind of latency in the user interface?