arLecture[0] = findViewById(R.id.lecture1);
arLecture[1] = findViewById(R.id.lecture2);
arLecture[2] = findViewById(R.id.lecture3);
arLecture[3] = findViewById(R.id.lecture4);
arLecture[4] = findViewById(R.id.lecture5);
arLecture[5] = findViewById(R.id.lecture6);
<resources>
<integer-array name="lectures">
<item>R.id.lecture1</item>
<item>R.id.lecture2</item>
<item>R.id.lecture3</item>
</integer-array>
</resources>
int[] lectures = getResources().getIntArray(R.array.lectures);
for (int i = 0; i < lectures.length; i++) {
arLecture.add(findViewById(lectures[i]));
}