开发者

How to pass array list object from one class to other class in android

开发者 https://www.devze.com 2023-03-20 02:58 出处:网络
My code in one class is ArrayList<String> categoryList=new ArrayList<String>(); // Intent mIntent = new Intent(this, listview.class);

My code in one class is

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 );

I want to pass array list object "categorylist" to other class in second class I have to get these values and i wnt to display thes values to listview

Please any one help me

Thanks In Advance


You can pass an ArrayList as an Extra to an Intent using putStringArrayListExtra (String name, ArrayList<String> value). See here for the documentation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号