title: Serializable an arrayList and Save it and to Read it
body: <p>I am trying to save a arrayList permanently each time when i click on the button the function will add the new arrayList in the Memory so when will read it in another activity  i will read all the arrayList that been save and like that  i will be able to keep my data even when i switch off the app and i will save all the history of the data been chosen by a click.</p>
  
  <p>This Activity is the one i will like to save the data from each time that the item been choose in the List by click</p>
  
  <p>and to save it in the memory and to be able read this data in another activity to be show that in a List</p>
  
  <pre><code>public class ResultView extends Activity 
  {
  protected static final String LOG_TAG = null;
  protected static final String EXTRA_BUTTONTEXT = null;
  protected static final int RECEIVE_MESSAGE = 0;
  
  String[] lv_arr = {};
  TextView title,sum;
  ListAdapter adapter;
  TextView t;
  private ListView lvUsers;
  private ArrayList&lt;Medicaments&gt; mListUsers;
  String responce=null;
  protected int count;
  
  private int FROMcountryChooseId,TOcountryChooseId;
  CharSequence meToConvert;
  private CharSequence nameOfFromcountry,nameOfTocountry;
  
  
  ArrayList&lt;History&gt; results = new ArrayList&lt;History&gt;();
  
  public void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.result); 
  
  
    //set the List of the product to the ListView
    mListUsers = getMedicamentsView();
    lvUsers = (ListView) findViewById(R.id.resultListView);
    lvUsers.setAdapter(new ListAdapter(this, R.id.resultListView, mListUsers)); 
  
    lvUsers.setOnItemClickListener(new OnItemClickListener()
    {
  
        private Object myObject;
  
      public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id)
        {
  
  
  
  
            Intent pingIntent = new Intent(getApplicationContext(),ConvertedView.class);
  
            //get the data from the listView in the right position
            int DCIN=mListUsers.get(position).DCIN;
            String molecule=mListUsers.get(position).DCI;
            String pathologie=mListUsers.get(position).Pathologie;
            String medicaments=mListUsers.get(position).Medicaments;
  
            //use pingIntent to share the data for the next Acitity
            pingIntent.putExtra("DCINChoosenMedicaments",DCIN);
            pingIntent.putExtra("moleculeChoosenMedicaments",molecule);
            pingIntent.putExtra("pathologieChoosenMedicaments",pathologie);
            pingIntent.putExtra("TOcountryChooseId",TOcountryChooseId);
  
            pingIntent.putExtra("nOfTocountry",nameOfTocountry);
             Log.i("Name of medicaments from ResultView **********************     "," "+nameOfTocountry);
  
             myObject=medicaments;
  
             //TODO:Save Data in the memory or or file 
  
  
  
             setResult(Activity.RESULT_OK,pingIntent);
  
  
            startActivity(pingIntent);
            //finish();
  
  
  
  
        }
     });
  
  
  
  }
  </code></pre>
  
  <p>I try to look on the web to fine a good explanation but nothing that could help me i am really lost on this subject i will appreciate Help</p>
  
  <p>Thank you Very much</p>