madhu y
madhu y

Reputation: 29

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

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

Upvotes: 0

Views: 719

Answers (1)

Zarah
Zarah

Reputation: 5189

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

Upvotes: 1

Related Questions