Skip to content

Instantly share code, notes, and snippets.

@omegasoft7
Created December 12, 2014 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omegasoft7/c20f8e9b7d80a4101f03 to your computer and use it in GitHub Desktop.
Save omegasoft7/c20f8e9b7d80a4101f03 to your computer and use it in GitHub Desktop.
// //show after fully load of layers
ViewTreeObserver vto = myview.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@SuppressLint("NewApi")
@Override
public void onGlobalLayout() {
//Do needs after load interface here
ViewTreeObserver obs = myview.getViewTreeObserver();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
obs.removeOnGlobalLayoutListener(this);
} else {
obs.removeGlobalOnLayoutListener(this);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment