简体   繁体   中英

pass arraylist via implicit intent

I want to pass my arraylist via implicit intent just because I want to send my data in listview via whatsapp. Here is my code

public void save()
{

   ArrayList<String> arrayList= new ArrayList<String>(Arrays.asList(combination));


    Intent intent= new Intent(Intent.ACTION_SEND);
    intent.setType("text/plain");

    intent.putStringArrayListExtra(Intent.EXTRA_TEXT,arrayList);

    startActivity(intent);
}

save() is a method that gets called when user presses SHARE button. But it actually doesn't pass anything to whatsapp.

Concatenate your strings together into one single string. Then, use that as your EXTRA_TEXT value. No application will be expecting an ArrayList<String> as the EXTRA_TEXT value, and so your existing code will not work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM