-1
        Bundle bundle = new Bundle();

        bundle.putParcelableArrayList("countiesof",
                (ArrayList<? extends Parcelable>) jsonDataList);
        Intent intent = new Intent(SplashActivity.this, HomeActivty.class);

        intent.putExtra("mycountries", jsonDataList);

        startActivity(intent);

Now ,I want to pass arraylist from one to another activity.

M D
  • 47,665
  • 9
  • 93
  • 114

3 Answers3

1
  Intent intent = new Intent(SplashActivity.this, HomeActivty.class);

   putStringArrayListExtra(String name, ArrayList<String> value)

    startActivity(intent);
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
Dakshesh Khatri
  • 639
  • 7
  • 12
0

You can declare you ArrayList as a static one like this,

public static ArrayList<String> array = new ArrayList<String>();

By doing this you can access your ArrayList from anywhere by

activity_name.array;

where activity_name is the activity or class in which you declare the static ArrayList

Amresh
  • 2,098
  • 16
  • 20
0

Already i've asked passing data one activity to another. pls read this thread.

How to pass bean class one activity to another activity on android

Community
  • 1
  • 1
RVG
  • 3,538
  • 4
  • 37
  • 64