title: Pass LinkedList to another activity
body: <p>I have a Linked List in one activity (A) that I want to share with another Activity (B). 
  The list contains a username of type string and contains coordinates of type LatLng. I am also using Intent and bundle to share data between activities. I tried using Parcelable but unable to figure out how to use it. Here is the code I have:</p>
  
  <p>data.java</p>
  
  <pre><code>public class data implements Parcelable{
      private LatLng coordinates;
      private String name;
  
  
      public data() {
          name = null;
          coordinates = null;
      }
  
      public data(String name, LatLng coordinates)
      {
          this.name = name;
          this.coordinates = coordinates;
      }
  
      public data(Parcel in) {
          coordinates = in.readParcelable(LatLng.class.getClassLoader());
          name = in.readString();
      }
  
      public static final Creator&lt;data&gt; CREATOR = new Creator&lt;data&gt;() {
          @Override
          public data createFromParcel(Parcel in) {
              return new data(in);
          }
  
          @Override
          public data[] newArray(int size) {
              return new data[size];
          }
      };
  
      public LatLng getLatLng () {
          return coordinates;
      }
  
      @Override
      public int describeContents() {
          return hashCode();
      }
  
      @Override
      public void writeToParcel(Parcel dest, int flags) {
          dest.writeString(name);
          dest.writeParcelable(coordinates, flags);
      }
  }
  </code></pre>
  
  <p>Activity A</p>
  
  <pre><code>public class A extends FragmentActivity implements
      OnMapReadyCallback,
      GoogleApiClient.ConnectionCallbacks,
      GoogleApiClient.OnConnectionFailedListener,
      GoogleMap.OnMyLocationButtonClickListener,
      ActivityCompat.OnRequestPermissionsResultCallback {
  
      Button switchToSeek;
      double mLatitude;
      double mLongitude;
  
      LinkedList&lt;data&gt; storedData = new LinkedList&lt;&gt;();
  
      protected void onCreate(Bundle savedInstanceState) {
          ...
          switchToSeek.setOnClickListener(new View.OnClickListener() {
                      @Override
                      public void onClick(View v) {
                          getCurrentLocation();
  
                          Intent intent = new Intent(A.this, B.class);
  
                          Bundle xy = new Bundle();
                          xy.putDouble("x", mLatitude);
                          xy.putDouble("y", mLongitude);
                          xy.putParcelable("list", storedData); &lt;---------- error: wrong second arugment
  
                          intent.putExtra("xy", xy);
                          A.this.startActivity(intent);
                      }
                  });
  </code></pre>
  
  <p>Activity B</p>
  
  <pre><code>public class B extends FragmentActivity implements OnMapReadyCallback {
  
      double mLatitude;
      double mLongitude;
      LatLng current;
      GoogleMap gMap;
  
      LinkedList &lt;data&gt; copyData = new LinkedList&lt;&gt;();
  
      @Override
          public void onMapReady(GoogleMap googleMap) {
              gMap = googleMap;
  
              ...
  
              Intent intent = getIntent();
              Bundle xy = intent.getBundleExtra("xy");
  
              if (xy != null) {
                  mLatitude = xy.getDouble("x");
                  mLongitude = xy.getDouble("y");
              }
             /***** Call linked list here and set equal to copyData *****/
  
              current = new LatLng(mLatitude, mLongitude);
              gMap.moveCamera(CameraUpdateFactory.newLatLngZoom(current, 18.0f));
  
          }
  </code></pre>