Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8971439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:57:21+00:00 2026-06-15T17:57:21+00:00

I have a Child Activity which is returning an ArrayList to Parent Activity Child

  • 0

I have a Child Activity which is returning an ArrayList to Parent Activity

Child Activity

ArrayList<Users> selectedMembers = new ArrayList<Users>();

//And then

Intent returnIntent = new Intent();

returnIntent.putExtra("ArrayOfUsers",selectedMembers);

setResult(RESULT_OK,returnIntent);        

finish();

Parent Activity

Now how to get this ArrayList<Users> on parent Activity

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data){
        if (resultCode == RESULT_OK) {


            //how to get ArrayList<Users> here
        }
    }

I did something like this but i gives error

selectedMembers.addAll((data.getParcelableArrayListExtra("ArrayOfUsers"));

error:

The method addAll(Collection<? extends Users>) in the type ArrayList<Users> is not applicable for the arguments (ArrayList<Parcelable>)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:57:22+00:00Added an answer on June 15, 2026 at 5:57 pm

    You are using different methods for serialization and deserialization. When you call returnIntent.putExtra actually this overloaded method in Intent class is called. So your list of users is actually treated as single Serializableobject. In this case putExtra at child side should be used in conjunction with getSerializableExtra getter at parent side.

    If you want to use getParcelableArrayListExtra at parent side as getter method you should use it in conjunction with putParcelableArrayListExtra at child side and you Users class should be Parcelable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main activity which calls a child one via Intent I =
I have a Parent activity which is sending data to child activity but the
I have a webview that I'm creating in an Activity which is a child
How I can get name of parent activity in child activity. I have two
I have an Activity named whereActity which has child dialogs as well. Now, I
I have an Activity which extends ExpandableListActivity and which contains some Parent Groups and
I have an android application that launches a child Activity under certain situations. Both
I have a LinearLayout and its child - ImageView. My activity's onCreate does nothing
If I have child class,the child class inherits all methods from the parent,but how
I have some child processes which should write some logs into a common file.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.