The following is a simple declaration in which a child and parent are constructed with a dynamic list value. With appropriate code like createGroupList() and createChildList() . I can manipulate using TextView , but one of the fields is my dynamic image, received before JSON , does not load into the WebView .
expListAdapter = new SimpleExpandableListAdapter( this, createGroupList(), // Creating group List. R.layout.group_row, new String[] { "Group Item" }, new int[] { R.id.`enter code here`row_name }, createChildList(), // Creating Child List. R.layout.child_row, new String[] { "Sub Item0", "Sub Item1", "Sub Item2", "Sub Item3" }, new int[] { R.id.grpChildName, R.id.grpChildAddress, R.id.grpChildPhoneNo, R.id.childImage } ); setListAdapter(expListAdapter); private List createGroupList() { String header = ""; int headerSize = 0; ArrayList result = new ArrayList(); for (int i = 0; i < dynamicList.size(); i++) { HashMap m = new HashMap(); String taxiCompanyData[] = dynamicList.get(i); if (header != taxiCompanyData[3]) { m.put("Group Item", taxiCompanyData[3]); header = taxiCompanyData[3]; headerList[headerSize] = header; headerSize++; result.add(m); counter++; } } return (List) result; } Above is Group creating and private List createChildList() { ArrayList result = new ArrayList(); Log.i("Info ", "headerList.length" + headerList.length); for (int i = 0; i < headerList.length; i++) { final ArrayList secList = new ArrayList(); System.out.println("dynamic list size is in main" + dynamicList.size()); webView = (WebView) findViewById(R.id.childImage); for (int j = 0; j < dynamicList.size(); j++) { String taxiCompanyData[] = dynamicList.get(j); if (taxiCompanyData[3].equalsIgnoreCase(headerList[i])) { final HashMap child = new HashMap(); child.put("Sub Item0", taxiCompanyData[0]); child.put("Sub Item1", taxiCompanyData[1]); child.put("Sub Item2", taxiCompanyData[2]); // child.put("Sub Item3", taxiCompanyData[4]); Thread th = new Thread(){ @Override public void run() { webView.loadUrl("https://lh5.googleusercontent.com/-u8heQyD_4y4/T5VMu-Zc6wI/AAAAAAAi71s/EP32a3D-fc0/s90/Corsino"); secList.add(child); }; }; th.start(); } } result.add(secList); } return (List)result; }
I can not load WebUI . Please help everyone.
source share