前も使ったが、ViewGroup.getChildCountで、子Viewの数を取得できる。
ViewGroup | Android Developers
childView1, childView2の子Viewの数を取得し、表示する。
childView1, childView2をViewGroupにキャスト。(childView1, childView2はLinearLayoutなのでViewGroupにキャストできる。)
getChildCountで子Viewの数を取得。
2つ。
こちらも2つ。
TextView1つだとおもっていたが。
何故だろう。
Sample/android/ViewGroup/getChildCount/src/ViewGroup at master · bg1bgst333/Sample · GitHub