I think the issue here may be related to the Activity containing the chart being paused because it is in the background. When a dialog appears on top of the chart containing Activity I'm pretty sure onPause will be called. If you are using a ChartFragment then this onPause signal will be automatically passed on to the chart. With ChartView you have to manually forward on the onPause call. This is required for the necessary clean up to be performed on the OpenGL rendering components that the chart uses. By forwarding calls to onResume everything is set up correctly again when the Activity is brought back in to focus.
However, it sounds like here your Annotator is appearing after the Dialog - is this another Activity or Dialog in itself (rather than just being a View over the ChartView in the original Activity)? If this is the case it probably means the chart containing Activity has not yet been resumed and so the charts are not displaying. To be fair I would have expected the charts to have remained on screen in this situation but it sounds like this isn't the case.
There are a number of areas you could look at:
- Call onPause() on the ChartView from the onStop() method in the Activity, and equally call onResume() from the onStart() method. It's not something I've tried myself and if you do go down this route I would make sure you do a lot of testing around the life-cycle of your app to ensure there are no unexpected consequences. Ultimately, onPause() should be going to onPause() (and onResume() to onResume()). This would also mean you wouldn't be able to use the ChartFragment as you won't be able to prevent the life-cycle forwarding on that.
- Take snapshots of the charts and place them in ImageViews when the chart containing Activity is put in the background.
- Make the Annotator a View in the chart containing Activity's View hierarchy - my thinking is that onResume() will have been called on the Activity so the charts should be correctly rendered.
I hope that gives you some pointers.