Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
API を使用しているため、アプリケーションに表示されるチェック ボックスの数がわかりません。アプリケーションで生成されたチェックボックスの数を取得するにはどうすればよいですか? また、これらの checkBoxes は listView 内で宣言されています。
レイアウト内のすべての子ビューをループして、そのうちのいくつがチェックボックスであるかを調べることができます。ループとチェックは次の方法で行われます。
ll is LinearLayout here int childcount = ll.getChildCount(); for (int i=0; i < childcount; i++){ View v = ll.getChildAt(i); if (view instanceof CheckBox) { count++; } }