如何将数组列表对象从一个类传递到android中的其他类

时间:2011-07-13 06:53:37

标签: android

我在一个班级的代码是

ArrayList<String> categoryList=new ArrayList<String>();

    // Intent mIntent = new Intent(this, listview.class);
    // mIntent.putExtra("nameOfArray",categoryList);

    // startActivity(mIntent);

       for(int i=0;i<docmntElmnt.getPropertyCount();i++)
       {

        SoapObject table = (SoapObject)docmntElmnt.getProperty(i);
        categoryList.add(table.getProperty("Nombre").toString());
        //categoryList.add(table.getProperty("Imagen1").toString());

       }
       Log.d(TAG,"Name and image of soap response is"+categoryList );

我想将数组列表对象“categorylist”传递给第二类中的其他类我必须获取这些值,并且我想将这些值显示给listview

请任何人帮助我

提前致谢

1 个答案:

答案 0 :(得分:1)

您可以使用ArrayListputStringArrayListExtra (String name, ArrayList<String> value)作为Extra传递给Intent。 See here for the documentation

相关问题