1

我有这样的java代码:

SimpleExpandableListAdapter expListAdapter =
                        new SimpleExpandableListAdapter(
                                this,
                                contactList,              
                                R.layout.bank_exchanger_list_element,             
                                new String[] { TAG_NAME, TAG_location_name, TAG_address, TAG_exchanger_type_name, TAG_latitude, TAG_longitude },
                                new int[] {
                                        R.id.bank_e_n, R.id.nas_punkt_e_n , R.id.adress_obm_e_n , R.id.tip_obm_e_n , R.id.shirota_e_n , R.id.dolgota_e_n },   
                                result,              //something goes here
                                R.layout.exchanger_currencies,             
                                new String[] {TAG_exchanger_curr_value, TAG_currency_list_name, TAG_direction_of_exchange_name},      
                                new int[] { R.id.currencyvalue_e_n, R.id.currency_list_name_e_n, R.id.direction_of_exchange_e_n}    
                            );
                        setListAdapter( expListAdapter );  

但对我来说主要的麻烦是我的结果变量可能是空的,然后我什么也看不到:父母和孩子......

但是,如果孩子是空的,我怎么能做到这一点,我可以在 ExpandableListAdapter 中显示父母的?现在它不显示( - 空

我试着写:if (result != null){ .... else....但这对我没有帮助

(我也在解析对象有孩子的json)

4

0 回答 0