ArrayListのサイズよりも小さい:recyclerview子カウントは私の好きなRecyclerviewの子を取得するアクティビティクラスで私の活動クラスで
final int itemsCount = recly_list_lab.getChildCount();
が、それは私の7項目数を与えたが、私は10アイテムを取得する方法を、次に10アイテムを持っています
主な活動にrecyclerViewために子アイテムを取得するため、この私のコード:recylerビュー内の
final int itemsCount = recly_list_lab.getChildCount();
Log.e("itemsCount::",itemsCount+"");
if (itemsCount != 0) {
try {
for (int i = 0; i <itemsCount; i++) {
final View viewtestcategoryname = recly_list_lab.getChildAt(i);
AutoCompleteTextView autoctv_testcategory = (AutoCompleteTextView) viewtestcategoryname.findViewById(R.id.autoctv_testcategory);
String TestCategoryName = autoctv_testcategory.getText().toString();
Log.e("TestCategoryname:",TestCategoryName);
AutofitRecyclerView grid_labreferal_checkboxes_test = (AutofitRecyclerView) viewtestcategoryname.findViewById(R.id.grid_labreferal_checkboxes_test);
final int itemcheckTestCount = grid_labreferal_checkboxes_test.getChildCount();
Log.e("itemcheckTestCount:",itemcheckTestCount+"");
RecyclerView recly_testsubcategory = (RecyclerView) viewtestcategoryname.findViewById(R.id.recly_testsubcategory);
final int itemSubCategoryName = recly_testsubcategory.getChildCount();
Log.e("itemSubCategoryName:",itemSubCategoryName+"");
for (int test_check = 0; test_check < itemcheckTestCount; test_check++) {
final View viewTestCheck = grid_labreferal_checkboxes_test.getChildAt(test_check);
CheckBox grid_labreferal_checkbox = (CheckBox) viewTestCheck.findViewById(R.id.grid_labreferal_checkbox);
TextView txt_item_id = (TextView) viewTestCheck.findViewById(R.id.txt_item_id);
if (grid_labreferal_checkbox.isChecked()) {
Log.e("%sgrid_lcheckbox", grid_labreferal_checkbox.getText().toString());
if (txt_item_id != null && txt_item_id.getText().toString().trim().length() != 0) {
}
}
}
for (int subcatname = 0; subcatname< itemSubCategoryName; subcatname++){
final View SubCategory = recly_testsubcategory.getChildAt(subcatname);
AutoCompleteTextView autoctv_testsubcategory = (AutoCompleteTextView) SubCategory.findViewById(R.id.autoctv_testsubcategory);
Log.e("subcategoryname::",autoctv_testsubcategory.getText().toString());
AutofitRecyclerView grid_labreferal_checkboxes_subtest= (AutofitRecyclerView) SubCategory.findViewById(R.id.grid_labreferal_checkboxes_subtest);
final int itemcheckSubtestCount = grid_labreferal_checkboxes_subtest.getChildCount();
Log.e("itemcheckTestCount:",itemcheckSubtestCount+"");
for (int test_check = 0; test_check < itemcheckSubtestCount; test_check++) {
// jsonObjectMulti = new JSONObject();
final View viewTestCheck = grid_labreferal_checkboxes_subtest.getChildAt(test_check);
CheckBox grid_labreferal_checkbox = (CheckBox) viewTestCheck.findViewById(R.id.grid_labreferal_checkbox);
TextView txt_item_id = (TextView) viewTestCheck.findViewById(R.id.txt_item_id);
if (grid_labreferal_checkbox.isChecked()) {
Log.e("%sgrid_subtestcheckbox", grid_labreferal_checkbox.getText().toString());
if (txt_item_id != null && txt_item_id.getText().toString().trim().length() != 0) {
//testUpload.put(txt_item_id.getText().toString().trim(), grid_labreferal_checkbox.getText().toString().trim());
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
あなたは完全なコードを共有できますか? – sumit
@sumit plzさんに私のメールID –
を与えてもらえますか? –