@Override
 public void onLayout(boolean changeSize, int left, int top, int right, int bottom) {
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null && layer.getMGLView() != null) {
       layer.getMGLView().doLayout(changeSize, left, top, right, bottom);
     }
   }
 }
 @Override
 public void pause() {
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null) {
       layer.onActivityPause();
     }
   }
   unbind();
   itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null) {
       if (mRootView != null && layer.getView() != null) {
         mRootView.removeView(layer.getView());
       }
       if (mGLRootView != null && layer.getMGLView() != null) {
         mGLRootView.removeComponent(layer.getMGLView());
       }
     }
   }
 }
 @Override
 public void resume() {
   Iterator<Entry<MediaType, Layer>> itr = mLayers.entrySet().iterator();
   while (itr.hasNext()) {
     Layer layer = itr.next().getValue();
     if (layer != null) {
       if (mRootView != null && layer.getView() != null) {
         mRootView.addView(layer.getView());
       }
       if (mGLRootView != null && layer.getMGLView() != null) {
         mGLRootView.addComponent(layer.getMGLView());
       }
       layer.onActivityResume();
     }
   }
 }
 @Override
 public void drawLayer(MGLCanvas canvas, int width, int height) {
   if (mCurrentLayer != null && mCurrentLayer.getMGLView() != null)
     mCurrentLayer.getMGLView().doDraw(canvas, width, height);
 }