Issue : Passing ArrayList between intents loses data [duplicate]

You can pass an ArrayList the same way, if the E type is Serializable. You would call the putExtra (String name, Serializable value) of Intent to store, and getSerializableExtra (String name) for retrieval. Example: ArrayList<String> myList = new ArrayList<String>(); intent.putExtra(“mylist”, myList); In the other Activity: ArrayList<String> myList = (ArrayList<String>) getIntent().getSerializableExtra(“mylist”);

Can anyone solve my Android Fragment issue? [closed]

Try this package com.example.myfragments; import android.os.Bundle; import android.app.Activity; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.content.res.Configuration; import android.view.WindowManager; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Configuration config = getResources().getConfiguration(); FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); /** * Check the device orientation and act accordingly */ if (config.orientation == Configuration.ORIENTATION_LANDSCAPE) … Read more