0

スピナーをオブジェクトにバインドしましたが、スピナーに(com.adroit.test1.test@444 ..)のような間違った値が入力されています

私のコードの何が問題になっていますか、どんな助けでもありがたいです

 JSONArray jsonarrayCountry=JSONFunction.getJSONCountry();  
        JSONObject jsonCountry=null;
        String[] arrayCounrty = new String[jsonarrayCountry.length()];
        //ArrayList<String> arrayCategary;
        try {
            for(int i=0;i< jsonarrayCountry.length();i++)
            {
                jsonCountry=jsonarrayCountry.getJSONObject(i);
                arrayCounrty[i]=jsonCountry.getString("Name");
                eexit item=new eexit();  
                item.setName(jsonCountry.getString("Name"));
                item.setId(Integer.parseInt(jsonCountry.getString("CountryID")));
                listCountry.add(item);  

                System.out.println("arrayCounrty::"+arrayCounrty[i]);
            }

        } catch (Exception e) {
            // TODO: handle exception
        }  

        ArrayAdapter<eexit> selcountryadapter = new ArrayAdapter<eexit>(this,           android.R.layout.simple_spinner_item, listCountry);

        selCountry.setAdapter(selcountryadapter);
4

1 に答える 1

1

カスタム クラスに toString() メソッドを実装する必要があります。

于 2012-08-01T05:25:04.873 に答える