已采納回答 / dengpei187
getChildAt這個方法只針對指示點布局的linerlayout,而不是ViewPager,所以調用的對象錯了,應該是ll_layout..getChildAt(i) .setBackgroundResource(index == i ? R.drawable.doc_focus:R.drawable.dot_normal);
2018-05-15