Skip to content

Instantly share code, notes, and snippets.

@valentincognito
Created June 15, 2018 06:45
Show Gist options
  • Save valentincognito/e25e8d439750a0c39d076d830e294668 to your computer and use it in GitHub Desktop.
Save valentincognito/e25e8d439750a0c39d076d830e294668 to your computer and use it in GitHub Desktop.
Loop through a Layout view to access all children
GridView myLayout = findViewById(R.id.myLayoutId);
for (int i = 0; i < myLayout.getChildCount(); i++) {
// Int our case the gridView contains videos
VideoView v = (VideoView) myLayout.getChildAt(i);
// Start the video
v.start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment